SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
I have successfully added text labels to my charts using ILabelProvider.
However, some of the charts are showing duplicate labels for each bar, and others are not showing the labels for all bars (even though there is space to do so).
Any idea how to fix these? See the attached images for more details.
Thanks in advance.
This occurs because of two reasons:
SciChart decides on the spacing of ‘ticks’ (Gridlines, labels) depending on your VisibleRange, Size of the Chart and Axis Type. You can learn about this here.
SciChart culls labels which overlap each other by default. This can be disabled by setting the AxisBase.IsLabelCullingEnabled property to false.
Regarding duplicate labels:
It is very likely that this is because of a mixture of (1) above and your own Labelprovider algorithm. For instance, if the Axis decides to create ticks at 1, 1.2, 1.4, 1.6, 1.8, 2.0 and you use a LabelProvider to convert the axis value to integer and choose a label, then you are going to get LabelA, LabelA, LabelA, LabelA, LabelB as a result.
What I would suggest is to use a combination of setting axis tick frequency.
Some useful documentation:
let me know if this helps!
Please login first to submit.