Issue
I am trying to update a chart's Series Data dynamically using a NumberSlider Widget, but I am encountering an error when deploying the app. The appsmith.store.graphData variable is undefined, and I'm not sure why. I need to find a solution to display different data in the chart based on the slider value without using appsmith.store.
Resolution
The solution to the error of appsmith.store.graphData being undefined when deploying the app is to use conditional rendering to ensure that the data is available before rendering the chart. The Series Data property of the chart widget can be modified to use appsmith.store.graphData if it exists, or an empty array if it doesn't.
{{appsmith.store.graphData ? appsmith.store.graphData : []}}
Alternatively, the NumberSlider widget's value can be used directly in the Series Data property of the chart widget by calling a function that fetches data based on the slider value. The function should be replaced with the actual function that fetches data.
{{fetchDataBasedOnSliderValue(NumberSlider1.value)}}