SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components


I want to modify the format of XAxis Label of example “MultiPaneStockCharts”, so I do this:

                            <Style TargetType="s:CategoryDateTimeAxis">

                                <!--added the format here, but does not work-->
                                <Setter Property="TextFormatting" Value="yyyy-MM-dd"/>

                                <Setter Property="DrawMajorBands" Value="True" />
                                <Setter Property="DrawMinorGridLines" Value="False" />
                                <Setter Property="VisibleRange" Value="{Binding ParentViewModel.XVisibleRange, Mode=TwoWay}" />
                                <Setter Property="GrowBy" Value="0, 0.05" />

But the format of the XAxis labels are not modified as I want it. It seems that something inside the example is preventing format setting, since in different zoom rate the label format is changing.

How can I modify the format?

Thank you.

  • You must to post comments

There is a property on CategoryDateTimeAxis called SubDayTextFormatting. You need to set this as well, as it will choose SubDayTextFormatting when the chart is zoomed in to less than one day.

For advanced text formatting and full customisation, please also see the LabelProvider feature. You will need to use a CategoryLabelProvider to format labels for the CategoryDateTimeAxis.

Let me know if this helps,

Best regards,

  • You must to post comments

I’ve tried SubDayTextFormatting, still not working.

Either the LabelProvider way. It seems that it is a CategoryDateTimeAxis, not a DateTimeAxis, and will not accept a DateTimeLabelProvider, saying :

Message=The DateTimeLabelFormatter is only valid on instances of DateTimeAxis

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.