public ISeriesControl GetPreviousSeriesHost(ISeriesControl current) { int index = GetSeriesIndex(current); if (index <= 0) { return(null); } return(GetSeriesHost(index - 1)); }
private int GetSeriesIndex(ISeriesControl seriesControl) { var item = seriesControl.DataContext; if (this.itemIndexMap.TryGetValue(item, out int index)) { return(index); } return(-1); }
public PointNS[] GetPreviousSeriesCoordinates(bool isAreaSeries) { var coordinates = GetCoordinates(); PointNS[] previous = null; switch (this.Owner.StackMode) { case StackMode.None: if (isAreaSeries) { previous = new[] { new PointNS(coordinates.First().X, 0), new PointNS(coordinates.Last().X, 0) }; } break; case StackMode.Stacked: case StackMode.Stacked100: ISeriesControl previousSeriesControl = GetPreviousSeriesHost(); if (previousSeriesControl == null) { if (isAreaSeries) { previous = new[] { new PointNS(coordinates.First().X, 0), new PointNS(coordinates.Last().X, 0) }; } } else { previous = previousSeriesControl.GetCoordinates(); if (previous.Length != coordinates.Length) { throw new MvvmChartException($"previous.Length({previous.Length}) != coordinates.Length({coordinates.Length})"); } } break; default: throw new ArgumentOutOfRangeException(); } return(previous); }
private void Sr_YValueRangeChanged(ISeriesControl sr, Range obj) { UpdateGlobalValueRange(); }