ChartDragInfo.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. namespace IndexFormula.Finance.Win
  2. {
  3. using IndexFormula.Finance;
  4. using System;
  5. public class ChartDragInfo
  6. {
  7. public int[] AreaHeight;
  8. public double AreaMaxY;
  9. public double AreaMinY;
  10. public DateTime EndTime;
  11. public FormulaHitInfo HitInfo;
  12. public DateTime StartTime;
  13. public ChartDragInfo(FormulaChart Chart, FormulaHitInfo HitInfo)
  14. {
  15. this.HitInfo = HitInfo;
  16. this.AreaHeight = new int[Chart.Areas.Count];
  17. FormulaAxisY axisY = HitInfo.AxisY;
  18. if ((axisY == null) && (HitInfo.Area != null))
  19. {
  20. axisY = HitInfo.Area.AxisY;
  21. }
  22. if (axisY != null)
  23. {
  24. this.AreaMinY = axisY.MinY;
  25. this.AreaMaxY = axisY.MaxY;
  26. }
  27. for (int i = 0; i < Chart.Areas.Count; i++)
  28. {
  29. FormulaArea area = Chart.Areas[i];
  30. this.AreaHeight[i] = area.Rect.Height;
  31. }
  32. this.StartTime = Chart.StartTime;
  33. this.EndTime = Chart.EndTime;
  34. }
  35. }
  36. }