I am using CategoryXAxis bound to DateTime component of my series. My chart has few data points (10 - 15). The problem I am facing is that the X axis doesn't show all the x-axis labels for my series, even though the chart width can easily fit the labels. This problem exists with all of the three series I tried: LineSeries, SplineSeries and ColumnSeries
Is there a way to force display all the X axis categories.
When the XamDataChart loads, it will determine a 'logical interval' for the chart labels based upon the number of labels and the chart's size. This can be overridden by setting the Interval property on your CategoryXAxis, as this property determines the frequency of when the labels are drawn. If you set this property to 1, you should see all of your labels drawn, as this will essentially set a frequency of "every category."
Please let me know if you have any other questions or concerns on this matter.
Thanks. That works, I will mark you answer as verified solution. Is there a feature to force XAxis labels which are important, even though they might get skipped in a normal rendering of the XamDataChart because of this 'logical interval'?
You can force "important" labels to render by using the corresponding axes' FormatLabel event. This event has a return type of "string" and what you return will tell the chart what to render for that particular label. The "item" argument for this event will return you your data item so that you can check the properties on it, so if you have a property that deems that particular label "important," you can check it and make sure it renders.
I would recommend that you set the Interval property on your axis to 1 on your CategoryXAxis and then use this FormatLabel event to return all of the labels that you want to show, and return string.Empty for the ones that you do not wish to show up.
I have attached a sample project to demonstrate the above. I hope this helps you.