Pre loader

DateTimeNumericAxis: Jan month is always displayed

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1
0

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.

Version
3.2.464
Images
  • You must to post comments
0
0

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

  • You must to post comments
0
0

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?

Images
  • You must to post comments
0
0

In order to resolve this issue, it may be necessary to verify that the transformDataToIndex function is invoked with the appropriate data or frames. It is feasible that the labelProvider necessitates the loading of data or the receipt of a check in order to determine the appropriate index.
https://www.scichart.com/questions/answers/geometry dash subzero

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.