You must be logged in to post your query.
Home › Forums › StockChart Support › stock chart with react
Hello,
Thanks for the slider update on stock chart! https://canvasjs.com/docs/stockcharts/methods/slider/set/
I m following react stock chart example. https://canvasjs.com/docs/stockcharts/integration/react/
With new library in place in m calling the set() method like this stockChartRef.current.options.navigator.slider.set('minimum', new Date(moment.unixSecondsToDate(chartSliderRange.maximum)));
stockChartRef.current.options.navigator.slider.set('minimum', new Date(moment.unixSecondsToDate(chartSliderRange.maximum)));
Getting error Uncaught TypeError: stockChartRef.current.options.navigator.slider.set is not a function
Uncaught TypeError: stockChartRef.current.options.navigator.slider.set is not a function
On logging stockChartRef.current.options.navigator.slider on the console, I can see the set() methos on the prototype property. May I know how to access set() method with react stock chart?
Regards
Shashank,
Slider methods are accessible within the actual slider element and not the options of slider that you pass to StockChart. As mentioned in documentation stockChart.navigator.slider.set('minimum', new Date(2018, 01, 01)); should work fine in your case.
stockChart.navigator.slider.set('minimum', new Date(2018, 01, 01));
If you are still facing issue, kindly share sample project reproducing the issue you are facing & share it with us over Google-Drive or Onedrive along with sample / dummy data so that we can run it locally to debug at our end to understand the use-case better and help you resolve.
— Vishwas R Team CanvasJS
You must be logged in to reply to this topic. Login/Register