Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何更改图表中X轴的位置_C#_Graph_Charts_Axis - Fatal编程技术网

C# 如何更改图表中X轴的位置

C# 如何更改图表中X轴的位置,c#,graph,charts,axis,C#,Graph,Charts,Axis,如何更改图表中X轴的位置,使其成为顶部?我在图片上展示了一个例子 更改轴的位置通常是通过将交叉属性设置为另一个垂直轴上的某个值来完成的: ca = chart1.ChartAreas[0]; ca.AxisX.Crossing = 2500; 但是在您的情况下,您可以简单地启用“辅助”轴AxisX2: ca.AxisX2.Enabled = AxisEnabled.True; 可能要禁用常规x轴: ca.AxisX.Enabled = AxisEnabled.False; 当然,您必须将各

如何更改图表中X轴的位置,使其成为顶部?我在图片上展示了一个例子


更改
轴的位置通常是通过将
交叉
属性设置为另一个垂直
轴上的某个值来完成的:

ca = chart1.ChartAreas[0];
ca.AxisX.Crossing = 2500;
但是在您的情况下,您可以简单地启用“辅助”轴
AxisX2

ca.AxisX2.Enabled = AxisEnabled.True;
可能要禁用常规x轴:

ca.AxisX.Enabled = AxisEnabled.False;

当然,您必须将各种样式和设置应用于新的次轴

欢迎来到堆栈溢出。我们无法从您的问题中看出您是如何制作示例图表的。请将您的问题显示为您用来生成它的一些代码。您是否解决了您的问题?