/// <summary> /// Fills a PointF array of data points absolute pixel positions. /// </summary> /// <param name="graph">Graphics object.</param> /// <param name="area">Chart area.</param> /// <param name="series">Point series.</param> /// <returns>Array of data points position.</returns> override protected PointF[] GetPointsPosition(ChartGraphics graph, ChartArea area, Series series) { PointF[] pointPos = new PointF[series.Points.Count + 1]; int index = 0; foreach (DataPoint point in series.Points) { // Change Y value if line is out of plot area double yValue = GetYValue(Common, area, series, point, index, 0); // Recalculates y position double yPosition = area.AxisY.GetPosition(yValue); // Recalculates x position double xPosition = area.circularCenter.X; // Add point position into array pointPos[index] = graph.GetAbsolutePoint(new PointF((float)xPosition, (float)yPosition)); // Rotate position float sectorAngle = area.CircularPositionToAngle(point.XValue); Matrix matrix = new Matrix(); matrix.RotateAt(sectorAngle, graph.GetAbsolutePoint(area.circularCenter)); PointF[] rotatedPoint = new PointF[] { pointPos[index] }; matrix.TransformPoints(rotatedPoint); pointPos[index] = rotatedPoint[0]; index++; } // Add last center point pointPos[index] = graph.GetAbsolutePoint(area.circularCenter); return(pointPos); }
protected override PointF[] GetPointsPosition(ChartGraphics graph, ChartArea area, Series series) { PointF[] array = new PointF[series.Points.Count + 1]; int num = 0; foreach (DataPoint point in series.Points) { double yValue = this.GetYValue(base.common, area, series, point, num, 0); double position = area.AxisY.GetPosition(yValue); double num2 = (double)area.circularCenter.X; array[num] = graph.GetAbsolutePoint(new PointF((float)num2, (float)position)); float angle = area.CircularPositionToAngle(point.XValue); Matrix matrix = new Matrix(); matrix.RotateAt(angle, graph.GetAbsolutePoint(area.circularCenter)); PointF[] array2 = new PointF[1] { array[num] }; matrix.TransformPoints(array2); array[num] = array2[0]; num++; } array[num] = graph.GetAbsolutePoint(area.circularCenter); return(array); }