[英]How to change the position of the X axis in the chart
Changing the position of an Axis
is usually done by setting the Crossing
property to some value on the other, perpendicular Axis
: 通常,通过将
Crossing
属性设置为另一个垂直Axis
上的某个值来更改Axis
的位置:
ca = chart1.ChartAreas[0];
ca.AxisX.Crossing = 2500;
But in your case you can simply enable the 'secondary' axis AxisX2
: 但是在您的情况下,您只需启用 “辅助”轴
AxisX2
:
ca.AxisX2.Enabled = AxisEnabled.True;
Probably you want to disable the regular x-axis: 可能您想禁用常规x轴:
ca.AxisX.Enabled = AxisEnabled.False;
Of course you will have to apply all sorts of stylings and settings to the new, secondary axis! 当然,您将必须将各种样式和设置应用于新的辅助轴!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.