Hello,
I switched from NumericAxis to DateTimeNumericAxis to view x axis labels in hh:mm format. It is definitely showing the labels in this format which is what I wanted, but for some reason it always show “Jan 1” in the first label. I simply want to show hh:mm labels based on the X values. One thing to now is that this is a live updating chart, not static data.
What am I missing? attached is a picture showing the issue and a picture with the DateTimeNumericAxis configuration.
Thanks.
Sergio.
- Sergio Faura asked 2 months ago
- You must login to post comments
Hello,
Thank you for the quick reply. I tried the suggestion but still no luck, I also added a prefix value which does not seem to show up. Any ideas on what I could be doing wrong?
- Sergio Faura answered 2 months ago
- You must login to post comments
Hi Sergio,
This behaviour is by-design, where you have a time-based axis with DateTimeNumericAxis
, it uses the SmartDateLabelProvider
type, which shows the date on day transitions and month name on month transitions. For example:
- Given these labels: 23:50, 23:55, 00:00, 00:05, 00:10, the middle label (00:00) will always show the date/day transition, such as Jan 1 (or whatever the date is)
- Given these labels as days of the month: 29, 30, 1, 2, 3 , the middle label (1) will always show the month name transition, such as Jan or Feb (or whatever the month is)
How to disable it
If you want a pure time axis with DateTimeNumericAxis
then set the LabeProvider property as follows:
const xAxis = new DateTimeNumericAxis(wasmContext, {
labelProvider: new DateLabelProvider({
labelFormat: ENumericFormat.Date_HHMM
cursorLabelFormat: ENumericFormat.Date_HHMM
})
});
This will give you fixed HH:MM format without the transitions on day/month, but it will no longer be dynamic as well.
If you require further control, I recommend reading the following articles
- Andrew Burnett-Thompson answered 2 months ago
- You must login to post comments
Please login first to submit.