Pre loader

How to get CategoryTimeAxis to display x Axis values when still empty?

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

Answered
1
0

I have 2 modes on my chart. One uses XAxis a NumericAxis and one uses DateTimeCategoryAxis. I can set the visible range when initilizing the control. The code should be the same in both cases except:

NumericAxis gets DoubleRange as VisibleRange
CategoryAxis gets IndexRange as VisibleRange

But if setting start and end value for the axis only the numericAxis displays something. The other one is empty.

I somehow understand that IndexRange is not really suitable to display anything if I set Min and Max Value and I haven’t yet understood how to transfer between DateTime values and the Index values but to start with:
How can I display the CategoryAxis the same as NumericAxis as long as the chart is empty?

Please see pictures.

Images
  • You must to post comments
Best Answer
2
0

Hi Uwe,

Thanks for your questions. Concerning the coordinate transformation for CategoryAxis, please take a look at this article from our Knowledgebase. The last section explains the case of CategoryAxis.

As to axis initialization, it is not possible to render a CategoryAxis without having any data on associated with it, since it is index-based. So you should append at least 1 data point, or two if you want a certain VisibleRange as the initial one. There is a special Y value reserved for such cases (also for making gaps), it is double.NaN. Therefor you could append a two data points with double.NaN as Y values and then remove/update them when actual data comes.

Hope this helps!

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies