internal virtual bool CanGraph(XYDataPoint dataPointXY) { if (ValueHelper.CanGraph(dataPointXY.XValueInScaleUnits) && ValueHelper.CanGraph(dataPointXY.YValueInScaleUnits) && (DoubleHelper.GreaterOrEqualWithPrecision(dataPointXY.XValueInScaleUnits, 0.0) && DoubleHelper.LessOrEqualWithPrecision(dataPointXY.XValueInScaleUnits, 1.0)) && DoubleHelper.GreaterOrEqualWithPrecision(dataPointXY.YValueInScaleUnits, 0.0)) return DoubleHelper.LessOrEqualWithPrecision(dataPointXY.YValueInScaleUnits, 1.0); return false; }
internal void SkipToFillValueAnimation(XYDataPoint dataPoint, string propertyName) { string storyboardKey = DependencyPropertyAnimationHelper.GetStoryboardKey(propertyName); StoryboardInfo storyboardInfo = (StoryboardInfo)null; if (!dataPoint.Storyboards.TryGetValue(storyboardKey, out storyboardInfo) || storyboardInfo.Storyboard.Children.Count <= 0) return; storyboardInfo.Storyboard.SkipToFill(); }
private void ChangeDataPointYValue(XYDataPoint dataPoint, object newValue) { if (dataPoint == null) return; double yvalueInScaleUnits = dataPoint.YValueInScaleUnits; double d = this.Series.YAxis.Scale == null ? double.NaN : this.Series.YAxis.Scale.ProjectDataValue(newValue); dataPoint.YValueInScaleUnitsWithoutAnimation = d; if (!double.IsNaN(d) && !double.IsNaN(yvalueInScaleUnits) && (this.IsSeriesAnimationEnabled && this.ChartArea != null)) { DependencyPropertyAnimationHelper.BeginAnimation(this.ChartArea, "YValueInScaleUnits", (object)yvalueInScaleUnits, (object)d, (Action<object, object>)((value1, value2) => { if (double.IsNaN(dataPoint.YValueInScaleUnitsWithoutAnimation)) return; dataPoint.YValueInScaleUnits = (double)value2; }), dataPoint.Storyboards, this.Series.ActualTransitionDuration, this.Series.ActualTransitionEasingFunction); } else { this.SkipToFillValueAnimation(dataPoint, "YValueInScaleUnits"); dataPoint.YValueInScaleUnits = d; } }
private double TransformYValueInScaleUnits(XYDataPoint dataPoint, double yValueInScaleUnits) { if (!this.IsHundredPercent(dataPoint)) return yValueInScaleUnits; Range<IComparable> pointYvalueRange = this.GetDataPointYValueRange(dataPoint); double val2 = (double)ValueHelper.ConvertValue((object)pointYvalueRange.Minimum, DataValueType.Float); double num = Math.Max(0.0, (double)ValueHelper.ConvertValue((object)pointYvalueRange.Maximum, DataValueType.Float)) - Math.Min(0.0, val2); NumericScale numericScale = this.Series.YAxis.Scale as NumericScale; if (num == 0.0) return this.Series.YAxis.Scale.ProjectDataValue(this.Series.YAxis.Scale.ActualCrossingPosition); Range<double> fromRange = new Range<double>(numericScale.Project(0.0), numericScale.Project(num)); Range<double> targetRange = new Range<double>(numericScale.Project(0.0), numericScale.Project(1.0)); return RangeHelper.Project(fromRange, yValueInScaleUnits, targetRange); }
private bool IsHundredPercent(XYDataPoint dataPoint) { return this.IsHundredPercent(dataPoint.Series); }
internal override double GetYOffsetInAxisUnits(XYDataPoint dataPoint, Point valuePoint, Point basePoint) { object xValue = ValueHelper.ConvertValue(dataPoint.XValue, ((XYSeries)dataPoint.Series).ActualXValueType); bool flag = valuePoint.Y < basePoint.Y; double num1 = 0.0; double num2 = 0.0; object clusterGroupKey = ((ColumnSeries)this.Series).ClusterGroupKey; foreach (XYDataPoint dataPointXY in Enumerable.Where<XYDataPoint>((IEnumerable<XYDataPoint>)this.GetCounterpartDataPoints(xValue, false), (Func<XYDataPoint, bool>)(p => this.IsDataPointViewVisible((DataPoint)p)))) { ColumnSeries columnSeries = dataPointXY.Series as ColumnSeries; if (clusterGroupKey != null && columnSeries != null) { if (ValueHelper.AreEqual(columnSeries.ClusterGroupKey, clusterGroupKey)) break; } Point positionInAxisUnits = this.GetPositionInAxisUnits(dataPointXY); if (flag) { if (positionInAxisUnits.Y < basePoint.Y) num1 += basePoint.Y - positionInAxisUnits.Y; } else if (positionInAxisUnits.Y > basePoint.Y) num2 += basePoint.Y - positionInAxisUnits.Y; } if (!flag) return num2; return num1; }
internal override Point GetPositionInAxisUnits(XYDataPoint dataPoint) { double x = this.Series.XAxis.AxisPresenter.ConvertScaleToAxisUnits(dataPoint.XValueInScaleUnits) ?? 0.0; double num = this.TransformYValueInScaleUnits(dataPoint, dataPoint.YValueInScaleUnits); StackedColumnDataPoint stackedColumnDataPoint = dataPoint as StackedColumnDataPoint; if (stackedColumnDataPoint != null) stackedColumnDataPoint.YValuePercent = num; double y = this.Series.YAxis.AxisPresenter.ConvertScaleToAxisUnits(num) ?? 0.0; return new Point(x, y); }
internal Range<IComparable> GetDataPointYValueRange(XYDataPoint p) { object index = ValueHelper.ConvertValue(p.XValue, this.Series.ActualXValueType); Range<IComparable> pointYvalueRange; if (!this.DataPointsByXValueRanges.TryGetValue(index, out pointYvalueRange)) { pointYvalueRange = this.GetDataPointYValueRange(index, this.GetCounterpartDataSeries(true)); this.DataPointsByXValueRanges[index] = pointYvalueRange; } return pointYvalueRange; }