更改图表控件轴颜色?

use*_*934 2 c# charts mschart

请看看这个:

在此输入图像描述

我可以修改Axis的默认黑色吗?我搜索过这个并改变了几个属性,但它仍然是黑色的.

Bea*_*425 6

你试过这个吗,Chart会是你创建的图表对象

//0 would be indice of chart area you wish to Change, Color.ColorYouWant
Chart.ChartAreas[0].AxisX.LineColor = Color.Red;
Chart.ChartAreas[0].AxisX.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;
Run Code Online (Sandbox Code Playgroud)