SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

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.