SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components
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.
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!
Please login first to submit.