Hi There,
I’m new to SciChart, I have a question regarding DateTimeAxis that is it possible to display the date when plotting data based on hours for multiple days?
For example, I’m plotting data for Aug/07, Aug/06, and Aug/05, so I have 72 data points to display, but the problem is the user can see all the data based on hours however, they will not be able to see when the day has changed. Is there any way I can achieve this.
- Umer Nawaz asked 3 years ago
- You must login to post comments
Hi Umer
Are you using the DateTimeAxis or CategoryDateTimeAxis?
DateTimeAxis uses something called SmartDateLabelProvider out of the box. This shows Year, Month, Day as well as hours dynamically depending on zoom.
CategoryDateTimeAxis doesn’t, but you can set this label provider by applying this line of code:
import {CategoryAxis} from "scichart/Charting/Visuals/Axis/CategoryAxis";
import { SmartDateLabelProvider } from "scichart/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider";
sciChartSurface.xAxes.add(new CategoryAxis(wasmContext, {
labelProvider: new SmartDateLabelProvider()
}));
Note that you can have precise control over axis labels using the LabelProvider feature. So if you wanted to format dates that are on the next day with a date prefix, you can.
Take look at the LabelProvider documentation here and specifically Custom LabelProviders.
I welcome your feedback if you need a specific behaviour. Let me know exactly how you want the axis to behave and I will give some suggestions.
Best regards
Andrew
- Andrew Burnett-Thompson answered 3 years ago
- You must login to post comments
Hi Andrew,
Thank you for your answer. I was able to achieve what I wanted to do using Custom LabelProviders
- Umer Nawaz answered 3 years ago
- last edited 3 years ago
- Great, glad for confirming! Best regards, Andrew
- You must login to post comments
Please login first to submit.