Category / Section
How do I draw the Y axis at the middle of the X axis?
1 min read
You can draw the Y axis at any custom position by using ChartAxisLocationType class. You have to set the type of the location as Set for the Y axis. By setting the LocationType as set you can change the location of the axis manually.
C#
// Drawing Y axis mid of the X axis
this.chartControl1.PrimaryYAxis.LocationType = ChartAxisLocationType.Set;
this.chartControl1.PrimaryYAxis.Location = new PointF(300, 352);
VB
'' Drawing Y axis mid of the X axis
Me.chartControl1.PrimaryYAxis.LocationType=ChartAxisLocationType.Set
Me.chartControl1.PrimaryYAxis.Location = New PointF(300, 352)
Please refer the sample in the below link which illustrates the above:
http://websamples.syncfusion.com/samples/KB/Chart.Windows/ChartSample/main.htm