IndicatorModel.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. 
  2. using MuchInfo.Chart.Data.EnumTypes;
  3. using MuchInfo.Chart.Data.Interfaces;
  4. using MuchInfo.Chart.Utilities.Enums;
  5. using System.Collections;
  6. using System.Collections.Generic;
  7. using System.Windows;
  8. using System.Windows.Media;
  9. namespace MuchInfo.Chart.Data.Models
  10. {
  11. /// <summary>
  12. /// 定义图表相关参数
  13. /// </summary>
  14. public class IndicatorModel
  15. {
  16. private const string _cond = "COND";
  17. private const string _upLineName = "PRICE2";
  18. /// <summary>
  19. /// 填充区域在Subdata中的键值
  20. /// </summary>
  21. public string FillRNGKey
  22. {
  23. get { return _upLineName; }
  24. }
  25. /// <summary>
  26. /// FillRNG绘图条件
  27. /// </summary>
  28. public string CondKey
  29. {
  30. get { return _cond; }
  31. }
  32. /// <summary>
  33. /// 图表类型
  34. /// </summary>
  35. public LinePlotType LinePlotType { get; set; } //todo:编辑器中比较多类型未实现
  36. /// <summary>
  37. /// 数据格式,如2f
  38. /// </summary>
  39. public string DataFormat { get; set; }
  40. /// <summary>
  41. /// Alpha值用于调整图表透明度
  42. /// </summary>
  43. public byte Alpha { get; set; }
  44. /// <summary>
  45. /// 点类型
  46. /// </summary>
  47. public PointDotType PointDotType { get; set; }
  48. /// <summary>
  49. /// 填充区域颜色
  50. /// </summary>
  51. public Color AreaBrush { get; set; }
  52. /// <summary>
  53. /// 点样式
  54. /// </summary>
  55. public DashStyleType DashStyleType { get; set; }
  56. /// <summary>
  57. /// 上升时颜色,如未使用两种颜色的图表,默认作为为图表颜色。
  58. /// </summary>
  59. public Color UpBrush { get; set; }
  60. /// <summary>
  61. /// 下降时颜色
  62. /// </summary>
  63. public Color DownBrush { get; set; }
  64. /// <summary>
  65. /// 坐标轴最大值多出百分比
  66. /// </summary>
  67. public double HighPercent;
  68. /// <summary>
  69. /// 文本对齐方式
  70. /// </summary>
  71. public TextAlignment TextAlignment { get; set; }
  72. /// <summary>
  73. /// 父公式
  74. /// </summary>
  75. public FormulaModel ParentFormula { get; set; }
  76. /// <summary>
  77. /// 是否和上一个公式画一样的颜色
  78. /// </summary>
  79. public bool SameColor { get; set; }
  80. /// <summary>
  81. /// 字体类型(与WinForm的Font还需设置样式等)
  82. /// </summary>
  83. public FontFamily FontFamily { get; set; }
  84. /// <summary>
  85. /// 经过公式计算的图表数据
  86. /// </summary>
  87. public List<ILineDataPoint> CalculateDataPoints { get; set; }
  88. /// <summary>
  89. /// 图表中存在多个数据进行绘图的数据
  90. /// </summary>
  91. public Hashtable SubData
  92. {
  93. get { return _subData; }
  94. }
  95. private Hashtable _subData = new Hashtable();
  96. /// <summary>
  97. /// 线条大小
  98. /// </summary>
  99. public double LineWidth { get; set; }
  100. /// <summary>
  101. /// 线名称
  102. /// </summary>
  103. public string LineName { get; set; }
  104. /// <summary>
  105. /// 是否为显示阴阳柱,区分大于0 与小于0;
  106. /// </summary>
  107. public bool PlotNegValsDiffColor { get; set; }
  108. /// <summary>
  109. /// 成交量柱
  110. /// </summary>
  111. public bool VolBar { get; set; }
  112. /// <summary>
  113. /// 是否为主图指标
  114. /// </summary>
  115. public bool IsMainIndicator { get; set; }
  116. /// <summary>
  117. ///
  118. /// </summary>
  119. /// <param name="parentFormula">父公式</param>
  120. public IndicatorModel(FormulaModel parentFormula)
  121. {
  122. this.ParentFormula = parentFormula;
  123. }
  124. /// <summary>
  125. /// 是否显昨收线
  126. /// </summary>
  127. private bool _isShowYestodayLines = true;
  128. public bool IsShowYestodayLines
  129. {
  130. get { return _isShowYestodayLines; }
  131. set { _isShowYestodayLines = value; }
  132. }
  133. }
  134. }