I want to modify the format of XAxis Label of example “MultiPaneStockCharts”, so I do this:
<s:SciStockChart.XAxisStyle>
<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" />
</Style>
</s:SciStockChart.XAxisStyle>
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.
- xing king asked 4 years ago
- You must login 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,
Andrew
- Andrew Burnett-Thompson answered 4 years ago
- You must login 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 :
“System.InvalidOperationException
HResult=0x80131509
Message=The DateTimeLabelFormatter is only valid on instances of DateTimeAxis
…”
- xing king answered 4 years ago
- You must login to post comments
Please login first to submit.