简体   繁体   中英

How to change the position of the X axis in the chart

How to change the position of the X axis in the chart, making it the top? I show example on the image

在此处输入图片说明

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM