I tried the WPF 2007 vol2, but could not find a way to change axis label's font for stack column chart.
Is there any to do that?
Try using:
axe.Label.AutoResize = false;
Changing the Font Size on the Axis Label seems to work, when the number of datapoints in the series is low. If there are too many datapoints, the specified font size is not applied. Is this a known issue? Is this by design?
I wanted the Font Size to be readable, so I went to the code behind and set the size for the font, but that doesn't seem to work. The formatting doesn't get applied, but the Units gets set correctly. Am I missing something? Here is the code: var axe = new Infragistics.Windows.Chart.Axis(); axe.Label.Format = "{0:MM-dd-yy}"; axe.Label.Angle = -45; axe.AxisType = Infragistics.Windows.Chart.AxisType.PrimaryX; axe.Label.FontFamily = new FontFamily("Arial"); axe.Label.FontSize = 20.0; axe.Label.Foreground = System.Windows.Media.Brushes.White; if (data.History.Count > 10) axe.Unit = data.History.Count / 10; xamChart1.Axes.Add(axe)
Could you please explain what is going on? I should clarify that I am using the DateTime on the X-axis of the chart and I checked my data to ensure that all dates are valid.
Hi,
The following sample shows how to set font for axis labels:
<igCA:XamChart Name="Chart1" Margin="8,8,8,8"> <igCA:XamChart.Series> <igCA:Series ChartType="StackedColumn"> <igCA:Series.DataPoints> <igCA:DataPoint Value="2"/> <igCA:DataPoint Value="8"/> <igCA:DataPoint Value="6"/> <igCA:DataPoint Value="7"/> </igCA:Series.DataPoints> </igCA:Series> <igCA:Series ChartType="StackedColumn"> <igCA:Series.DataPoints> <igCA:DataPoint Value="4"/> <igCA:DataPoint Value="7"/> <igCA:DataPoint Value="2"/> <igCA:DataPoint Value="9"/> </igCA:Series.DataPoints> </igCA:Series> </igCA:XamChart.Series> <igCA:XamChart.Axes> <igCA:Axis> <igCA:Axis.Label> <igCA:Label FontFamily="Algerian" FontSize="30"/> </igCA:Axis.Label> </igCA:Axis> </igCA:XamChart.Axes> </igCA:XamChart>
Thanks,
GoranS