2012-07-04 104 views
4

我想更改Y軸標籤的字體大小。如何更改Y軸標籤字體大小?

我想...

AxisY LineColor="64, 64, 64, 64" LabelAutoFitMinFontSize="5" 
    LabelStyle Font="NanumGothic, 5pt" 

Chart1.ChartAreas["ChartArea1"].AxisX.LabelStyle.Font.Size = 5; 

,但它不工作。 即使我擴展或縮小它的大小,它的大小也不能修改。

請幫我... !! :)

回答

6

而不是嘗試直接更改字體大小,分配字體與您需要的樣式。例如:

Chart1.ChartAreas.["ChartArea1"].AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 2.25F, System.Drawing.FontStyle.Bold); 

取決於你在做什麼,你可能還需要IsLabelAutoFit設置爲false也是如此。

9

您似乎忘記更改此軸的自動貼合樣式。它默認設置替換您的字體大小

Chart1.ChartAreas.["ChartArea1"].AxisY.LabelAutoFitStyle 
    = LabelAutoFitStyles.None; 
Chart1.ChartAreas.["ChartArea1"].AxisX.LabelStyle.Font 
    = new System.Drawing.Font("Trebuchet MS", 2.25F, System.Drawing.FontStyle.Bold); 
7

你試試這可能是其工作

Chart1.ChartAreas["ChartArea1"].AxisX.TitleFont = new Font("your required font",uyour required size, FontStyle.your required style); 

設置標題顏色

Chart1.ChartAreas [ 「ChartArea1」。AxisX.ForeColor =顏色。紅;

1

祕密不在chartArea,但在系列:

Chart1.Series["SerieName"].Font = new Font("Arial", 7, FontStyle.Bold); 
相關問題