【问题标题】:Change Chart control Axis color?更改图表控件轴颜色?
【发布时间】:2014-03-13 17:24:03
【问题描述】:

请看这个:

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

【问题讨论】:

    标签: c# charts mschart


    【解决方案1】:

    您尝试过吗,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;
    

    【讨论】:

    • 第二行应该是:Chart.ChartAreas[0].AxisY.LineColor = Color.Red;而不是 Chart.ChartAreas[0].AxisX.LineColor = Color.Red;
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多