I’m using a DateTimeNumericAxis as my xAxis.
As an example, 1 of my records date time is set to: 2024-08-02T15:00:00+10:00
They are converted to a timestamp value of 1722574800 and add it to the series.xValues, because it’s the format that SciChart reads. However, the xAxis label is being translated as August 2, 2024 5:00:00 AM instead of August 2, 2024 3:00:00 PM.
My current workaround is to create custom labels by updating the xAxis.labelProvider.formatLabel and labelProvider.formatCursorLabel of the xAxis. So now, I can convert it to toLocaleDateString with options: month: ‘short’, day: ‘numeric’ . But it’s not as compact as the default labels.
Default Axis Labels: Jul 27 28 29 30 31 Aug 02
Custom Axis Labels: 26 Jul 27 Jul 28 Jul 29 Jul 30 Jul 31 Jul 01 Aug 02Aug
See attached images with default vs custom labels
Question: How do I go about making sure that the Axis Labels and Axis Cursor labels follows the actual DateTime (2024-08-02T15:00:00+10:00) without making any custom axis labels?
- Maryjes Chapman asked 2 months ago
- You must login to post comments
A solution for this would be to override label provider methods:
formatDateWide(labelRange: ETradeChartLabelFormat | string, value: number);
formatDatePrecise(labelRange: ETradeChartLabelFormat | string, value: number);
- Jim Risen answered 2 months ago
- You must login to post comments
Please login first to submit.