I am using a chart (DataVisualization.Charting.Chart
) and letting the chart decide the font size for the axes labels (IsLabelAutoFit = True
for each axis). After the chart is drawn, I want to know the actual font size used. Microsoft documentation says that LabelStyle.Font
is for both Get
and Set
. However, the Get always returns the default font size (8 pts) rather than the actual font size used. How can I get the true font size used by the chart?
Dim OriginalXLabelFont As Font = thisChart.ChartAreas("ChartArea1").AxisX.LabelStyle.Font
Dim OriginalXTitleFont As Font = thisChart.ChartAreas("ChartArea1").AxisX.TitleFont
I expect the OriginalXLabelFont
to be the actual font size used by the chart, but it always just the default size. On the other hand, OriginalXTitleFont
properly gives me the actual Title font size that was used. However, the title font is fixed, and does not change dynamically when the chart is drawn. How can I get the axis label font size of the as-drawn chart?