Changing the position of an Axis
is usually done by setting the Crossing
property to some value on the other, perpendicular Axis
:
ca = chart1.ChartAreas[0];
ca.AxisX.Crossing = 2500;
But in your case you can simply enable the 'secondary' axis AxisX2
:
ca.AxisX2.Enabled = AxisEnabled.True;
Probably you want to disable the regular x-axis:
ca.AxisX.Enabled = AxisEnabled.False;
Of course you will have to apply all sorts of stylings and settings to the new, secondary axis!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.