c# - 更改图表控件轴颜色?

标签 c# charts mschart

请看这个:

enter image description here

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

最佳答案

您尝试过吗,Chart 将是您创建的图表对象

//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;

关于c# - 更改图表控件轴颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22386260/

相关文章:

c# - 在旧 ASP.NET 4.8 中读取和传播 TraceId

C#:重写 ProgressBar 上的 OnPaint 不起作用?

c# - 尽管 Runat = Server,但 ASP.net 代码中的表单字段为空

javascript - 清除 DIV 标签无效

c# - 如何对齐两个(或更多)图表的大小、滚动和网格

c# - 防止 Visual Studio 在 ASP.Net MVC View 中自动缩进 C# 代码

d3.js - 翻转 D3 堆积条形图的 x 轴

javascript - 使用 zingchart 加载 CSV 文件

mschart - Microsoft Chart 控制图例项目排序

c# - 将数据读取器绑定(bind)到 asp 图表控件