Пример #1
0
        /// <summary>
        /// Repositions line data point in the sorted collection if the actual
        /// independent axis is a range axis.
        /// </summary>
        /// <param name="dataPoint">The data point that has changed.</param>
        /// <param name="oldValue">The old value.</param>
        /// <param name="newValue">The new value.</param>
        protected override void OnDataPointIndependentValueChanged(DataPoint dataPoint, object oldValue, object newValue)
        {
            if (ActualIndependentAxis is IRangeAxis && !oldValue.Equals(newValue))
            {
                bool removed = DataPointsByIndependentValue.Remove((IComparable)oldValue, dataPoint);
                if (removed)
                {
                    DataPointsByIndependentValue.Add((IComparable)newValue, dataPoint);
                }
            }

            base.OnDataPointIndependentValueChanged(dataPoint, oldValue, newValue);
        }
Пример #2
0
        /// <summary>
        /// Called after data points have been loaded from the items source.
        /// </summary>
        /// <param name="newDataPoints">New active data points.</param>
        /// <param name="oldDataPoints">Old inactive data points.</param>
        protected override void OnDataPointsChanged(IList <DataPoint> newDataPoints, IList <DataPoint> oldDataPoints)
        {
            base.OnDataPointsChanged(newDataPoints, oldDataPoints);

            if (ActualIndependentAxis is IRangeAxis)
            {
                foreach (DataPoint dataPoint in oldDataPoints)
                {
                    DataPointsByIndependentValue.Remove((IComparable)dataPoint.IndependentValue, dataPoint);
                }

                foreach (DataPoint dataPoint in newDataPoints)
                {
                    DataPointsByIndependentValue.Add((IComparable)dataPoint.IndependentValue, dataPoint);
                }
            }
        }