SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!
Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.
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.
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!
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!
Please login first to submit.