You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm hoping somebody can help me with this error I keep getting while trying to implement a line chart: Uncaught TypeError: Cannot read properties of undefined (reading 'some'). I have a page where I'm dispatching the custom hook to get the data from API, once I have it I conditionally render the chart which has the data as a prop - see more below.
I can see the data is being passed correctly to the chart component; however I keep getting the undefined error and it stems from the function below. What am I missing?! Any advice or tips would be greatly appreciated!
function getFirstDefinedValue(options, data) {
var firstDefinedValue;
data.some(function (serie) {
return serie.data.some(function (originalDatum) {
var value = options.getValue(originalDatum);
if (value !== null && typeof value !== 'undefined') {
firstDefinedValue = value;
return true;
}
});
});
return firstDefinedValue;
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I'm hoping somebody can help me with this error I keep getting while trying to implement a line chart:
Uncaught TypeError: Cannot read properties of undefined (reading 'some')
. I have a page where I'm dispatching the custom hook to get the data from API, once I have it I conditionally render the chart which has the data as a prop - see more below.I can see the data is being passed correctly to the chart component; however I keep getting the undefined error and it stems from the function below. What am I missing?! Any advice or tips would be greatly appreciated!
This is the main page:
Chart component:
Beta Was this translation helpful? Give feedback.
All reactions