Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/295.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# 更改图表控制轴颜色?_C#_Charts_Mschart - Fatal编程技术网

C# 更改图表控制轴颜色?

C# 更改图表控制轴颜色?,c#,charts,mschart,C#,Charts,Mschart,请看一下: 我可以修改轴的默认黑色吗? 我已经搜索了它并更改了几个属性,但它仍然是黑色的。您是否尝试过此方法,图表将是您创建的图表对象 //0 would be indice of chart area you wish to Change, Color.ColorYouWant Chart.ChartAreas[0].AxisX.LineColor = Color.Red; Chart.ChartAreas[0].AxisY.LineColor = Color.Red; //To chan

请看一下:

我可以修改轴的默认黑色吗?
我已经搜索了它并更改了几个属性,但它仍然是黑色的。

您是否尝试过此方法,图表将是您创建的图表对象

//0 would be indice of chart area you wish to Change, Color.ColorYouWant
Chart.ChartAreas[0].AxisX.LineColor = Color.Red;
Chart.ChartAreas[0].AxisY.LineColor = Color.Red;

//To change the Colors of the interlacing lines you access them like so
Chart.ChartAreas[0].AxisX.InterlacedColor = Color.Red;
Chart.ChartAreas[0].AxisY.InterlacedColor = Color.Red;

//If you are looking to change the color of the Grid Lines
Chart.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.Red;
Chart.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.Red;

第二行应该是:Chart.ChartAreas[0]。AxisY.LineColor=Color.Red;而不是图表。图表区域[0]。AxisX.LineColor=Color.Red;