Reputation: 201
I have created few MS charts. Below code extracted from my application. It is working fine. but I want to increase the font size of label. How can I change the font size of label ?
Thanks.
Series MIN = Chart2.Series.Add("Minimum");
MIN.Points.DataBindXY(listVersion, MIN_list[j]);
MIN.ChartType = SeriesChartType.Line;
MIN.Color = Color.Red;
MIN.BorderWidth = 3;
MIN.IsValueShownAsLabel = true;
MIN.LabelBackColor = System.Drawing.Color.Red;
MIN.LabelForeColor = System.Drawing.Color.White;
Upvotes: 3
Views: 13293
Reputation: 54433
You can change the Font
individually for each DataPoint
:
MIN.Points[0].Font = new System.Drawing.Font("Consolas", 10f);
MIN.Points[1].Font = new System.Drawing.Font("Consolas", 12f);
MIN.Points[2].Font = new System.Drawing.Font("Consolas", 14f);
Or you can change the Font
for all Labels
of your series:
MIN.Font = new System.Drawing.Font("Times", 16f);
Upvotes: 2
Reputation: 10236
Chart2.ChartAreas.["yourChartArea"].AxisY.LabelAutoFitStyle = LabelAutoFitStyles.None;
Chart2.ChartAreas.["yourChartArea"].AxisX.LabelStyle.Font
= new System.Drawing.Font("Trebuchet MS", 2.25F, System.Drawing.FontStyle.Bold);
Upvotes: 3