簡體   English   中英

如何更改圖表標簽的前景色?

[英]how can I change forecolor of a chart label?

如何更改圖表標簽的前景? 這是圖表的截圖 在此輸入圖像描述

我嘗試使用chart1.series [0] .FontForeColor = color.white; 但整個圖表變白了。

嘗試這個:

        this.chart1.BackColor = Color.AliceBlue;

        this.chart1.ChartAreas[0].AxisX.LineColor = Color.Red;
        this.chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.Red;
        this.chart1.ChartAreas[0].AxisX.LabelStyle.ForeColor = Color.Red;

        this.chart1.ChartAreas[0].AxisY.LineColor = Color.Red;
        this.chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.Red;
        this.chart1.ChartAreas[0].AxisY.LabelStyle.ForeColor = Color.Red;

這里LabelStyle.ForeColor根據您的要求更改標簽顏色。

LineColorMajorGrid.LineColor屬性允許修改網格線(屏幕截圖中的黑色),以防您需要。 當然,顏色Red和AliceBlue就是例如。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM