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
- jsimoes asked 11 years ago
- You must login to post comments
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
- Yuriy Zadereckiy answered 11 years ago
-
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 login to post comments
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
- Andrew Burnett-Thompson answered 11 years ago
- You must login to post comments
Please login first to submit.