Pre loader

TextFormatting on CategoryDateTimeAxis

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hi,

I’m trying to set the text format for a date time axis without success, the labels always show time only like hh:mm, no matter what is the textformat string or the zoom level.
Tried with “dd-MMM-yyy hh:mm”, “dd-MMM”, “g”.

Appreciate you help on this.
Thanks

  • You must to post comments
0
0

Hi there,

The TextFormatting property doesn’t work with the CategoryDateTimeAxis (as well as SubDayTextFormatting), because its label formatting depends on zoom level. You have to implement ILabelFormatter and set axis.LabelFormatter property to change the default formatting behavior(which is defined in the TradeChartAxisLabelFormatter).

Hope this helps!

Best regards,
Yuriy

  • jsimoes
    Hi Yuriy, Thanks for your explanation. I've just realized that was wrongly using the CategoryDateTimeAxis instead of the DateTimeAxis. Nevertheless I couldn't find any examples or explanations regarding ILabelFormatter implementation. PS: I'm testing the Silverlight component and I have to say that it's very good. The performance is absolutely awesome! Good job. :)
  • You must to post comments
0
0

Hello,

TextFormatting should work fine on DateTimeAxis. Also see SubDayTextFormatting which changes the format string (e.g. from dd-MMM-yyyy to HH:mm) when the interval between axis Max/Min is under a day.

LabelFormatter, you’re right – no examples on it. It’s part of our “Workaround API” which we break out when a customer has a particular issue that can’t be solved with the standard API demonstrated by our examples.

There is a known bug where TextFormatting is overriden by the CategoryDateTimeAxis.LabelFormatter, but we haven’t prioritised it for fixing just yet. It needs a bit more thought.

Anyway if you have any questions or issues that crop up, feel free to ask!

Best regards,
Andrew

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies