Hi,
I am trying to create a chart that looks somewhat similar to the attached image. I am not sure how can I achieve this as the Y axis as you can see should appear at the middle of the chart and the left portion of the chart will show a set of data that will use a different scale than that of the right portion of the chart and hence the scale used by the left side will be different compared to the scale on the right side(sample scale marking shown on image attached). I tied using layouts and adding those to chart but could not get the desired result yet as shown in the image . Also I need to draw the bars with dynamic colors as per the variable values computed in runtime. Can you please help me achieving the desired result as shown in attached image.
Thanks,
Amitabha
|
private void ChartControl1_ChartAreaPaint(object sender, PaintEventArgs e)
{
Point ptX = this.chartControl1.ChartArea.GetPointByValue(new ChartPoint(this.chartControl1.PrimaryXAxis.Range.Max, this.chartControl1.PrimaryYAxis.Range.Min));
PointF ptX1 = new PointF(ptX.X - 7, ptX.Y + 7);
PointF ptX2 = new PointF(ptX.X, ptX.Y);
PointF ptX3 = new PointF(ptX.X + 7, ptX.Y + 7);
e.Graphics.FillPolygon(Brushes.Black, new PointF[] { ptX1, ptX2, ptX3 });
Point ptY = this.chartControl1.ChartArea.GetPointByValue(new ChartPoint(this.chartControl1.PrimaryXAxis.Range.Min, this.chartControl1.PrimaryYAxis.Range.Max));
PointF ptY1 = new PointF(ptY.X + 7, ptY.Y - 7);
PointF ptY2 = new PointF(ptY.X, ptY.Y);
PointF ptY3 = new PointF(ptY.X + 7, ptY.Y + 7);
e.Graphics.FillPolygon(Brushes.Black, new PointF[] { ptY1, ptY2, ptY3 });
var right = this.chartControl1.Axes[2].GetCoordinateFromValue(this.chartControl1.Axes[2].Range.Max);
PointF ptsecondY1 = new PointF(right - 7, ptY2.Y - 7);
PointF ptsecondY2 = new PointF(right, ptY2.Y);
PointF ptsecondY3 = new PointF(right - 7, ptY2.Y + 7);
e.Graphics.FillPolygon(Brushes.Black, new PointF[] { ptsecondY1, ptsecondY2, ptsecondY3 });
}
ChartSeriesLegendItem previousSelectedItem;
Syncfusion.Drawing.BrushInfo previousColor; |
Thanks Yuvaraj,
It Helped.
Amit