Beispiel #1
0
        public EasyChartXPlotArea GetHitPlotArea(HitTestResult result)
        {
            ChartElementType hitObject    = result.ChartElementType;
            ChartArea        hitChartArea = result.ChartArea;

            if (null == hitChartArea || (hitObject != ChartElementType.PlottingArea &&
                                         hitObject != ChartElementType.Gridlines && hitObject != ChartElementType.StripLines &&
                                         hitObject != ChartElementType.DataPoint && hitObject != ChartElementType.Axis))
            {
                return(null);
            }
            EasyChartXPlotArea hitPlotArea = null;

            if (ReferenceEquals(MainPlotArea.ChartArea, hitChartArea))
            {
                hitPlotArea = MainPlotArea;
            }
            else
            {
                int plotAreaIndex = SplitPlotAreas.FindIndexByBaseChartArea(hitChartArea);
                if (plotAreaIndex >= 0 && plotAreaIndex < SplitPlotAreas.Count)
                {
                    hitPlotArea = SplitPlotAreas[plotAreaIndex];
                }
            }
            return(hitPlotArea);
        }
Beispiel #2
0
 /// <summary>
 /// 匹配绘图区
 /// </summary>
 internal void AdaptView()
 {
     MainPlotArea.Enabled = !_isSplitView;
     if (IsSplitView && _plotManager.SeriesCount != SplitPlotAreas.Count)
     {
         SplitPlotAreas.AdaptPlotAreaCount(_plotManager.SeriesCount);
         ApplyMainPlotAreaToAll();
     }
     for (int i = 0; i < SplitPlotAreas.Count; i++)
     {
         SplitPlotAreas[i].Enabled = (IsSplitView && i < _plotManager.SeriesCount);
     }
     // TODO to check
     AdaptPlotAreas();
 }
 public void RefreshAxesRange(StripChartXPlotArea plotArea)
 {
     if (ReferenceEquals(MainPlotArea, plotArea))
     {
         AdaptMainPlotAreaAxesRange();
     }
     else
     {
         int areaIndex = SplitPlotAreas.IndexOf(plotArea);
         if (areaIndex >= 0)
         {
             AdaptSplitPlotAreaAxesRange(areaIndex);
         }
     }
 }
Beispiel #4
0
        public void RefreshAxesRange(EasyChartXPlotArea plotArea)
        {
            double maxXRange = _plotManager.GetMaxXData();
            double minXRange = _plotManager.GetMinXData();

            if (ReferenceEquals(MainPlotArea, plotArea))
            {
                AdaptMainPlotAreaAxesRange(maxXRange, minXRange);
            }
            else
            {
                int areaIndex = SplitPlotAreas.IndexOf(plotArea);
                if (areaIndex >= 0)
                {
                    AdaptSplitPlotAreaAxesRange(areaIndex, maxXRange, minXRange);
                }
            }
        }