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

1
0

Hello,

I have a BlazorWASM app. I am wondering how to sync the x values of different renderable series that have different number of data points.

In a simple form, I am passing in the data for a moving average to be rendered on the chart that has already been populated with data. The moving average data has already been calculated and has the correct date timestamps. But when I add this series to the chart it is starting at index 0 of where the the price data started instead of where the xAxis date of this renderable series has.

I prefer not to use the filters api to regenerate this data as some will be complex and have already been calculated by study or pulled from a database. I have seen the article to offset a series but this seems unnecessary since I already have the x axis coordinate that I want each point of the new line series to be rendered.

Is there somewhere in the docs that I missed how to get these renderable series to line up properly to their own x data points?

Thank you

Version
2.2.2351
  • You must to post comments
0
0

Apparently this is coming from my misunderstanding of the different types of axes in scichart. The category axis ignores the data values and uses indexes so all the data series will need to have the same amount of data points. This creates a problem specifically in blazor using JSInterop as the default serializer is not able to serialize a double.NAN. But that is a separate issue.

  • Andrew Burnett-Thompson
    Hi Leland, got it. We’re not aware of this issue and how Blazor interops with JavaScript. Maybe another ‘magic number’ could be used for null points? Or helper functions for populating dataseries. BTW you may be interested to know, one of our customers is working on open sourcing a blazor wrapper for scichart.js. More info soon
  • Leland
    If I remember correctly I think SciChart renderable series cant take a null y value it needs a double.NaN for an empty data point. Since the default jsInterop serialize can not serialize double.NaN I ‘fixed’ the issue by passing in null values to js then running a filter on the data to change any null values to double.NaN before passing it to scichart. A bit clunky as it needs to happen often but it suffices for now. And yes any information on this project would be great! Thank you
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.