SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
Hi
I am trying out JS SciChart based on the Blazor example you have posted more than a year ago.
I cannot get the auto scaling to work by code (the default behavior does auto scale once right after adding the data). Calling sciChartSurface.zoomExtents(); (or zoomExtentsX() and zoomExtentsY() after one another) does zoom into a very details portion of the graph.
Also (maybe related) the tooltip does not update when moving the cursor around, it always keeps the same data. I tried using CursorModifier as well as RolloverModifier, both having the same problem.
Attached the JS code and the c# files and a picture how this looks like after calling the autoScale() method.
Thanks for any help
Regards
Reto
Hello,
In this case, to make it work properly with v2.0.2115 of the lib, you need to specify if the data is sorted with the “dataIsSortedInX” option in the Data Series definition:
const xyDataSeries = new XyDataSeries(wasmContext, {dataIsSortedInX: false});
FYI, this is handled automatically in the newer versions of the library (2.1.x).
So alternatively you can simply update the version of SciChart used in your project.
Best Regards,
Ivan
Hi Ivan
Thanks a lot for the quick answer. Indeed updating to v2.1.2301 fixed the tooltip issue, but the auto scaling (calling sciChartSurface.zoomExtents()) still requires the dataIsSortedInX:false. After adding that it worked perfectly!
Thanks again
Kind regards
Reto
Please login first to submit.