-
Notifications
You must be signed in to change notification settings - Fork 12k
Description
Expected Behavior
for no exception to be thrown at all.
Current Behavior
can't access property "x", point is undefined gets thrown if any of the dataset's data arrays is empty.
Possible Solution
no idea really, but for me setting the data array to [null] made the exception vanish without any noticeable side effects.
Steps to Reproduce
my apologies, but i won't be submitting an example via codepen since my brain has melted enough for now.
alternative step(s) to reproduce:
- visit https://www.chartjs.org/samples/master/charts/line/interpolation-modes.html
- run
myLine.config.data.datasets[0].data = [](aka: set the data of any dataset with a tension of like 0.4 to empty) - cause it to redraw (e.g. by resizing the browser window slightly)
- notice the
can't access property "x", t is undefinedexception
Context
for me the datasets get initialized with an empty data[] array while a background ajax request fetches the actual data and updates this afterwards, typing this i realize i might as well just not initialize that dataset until there is actual data present, but i spent like an hour trying to debug this so i'm just sharing my find here hoping it will help anyone else with their project ❤️
Environment
- Chart.js version:
^3.0.0-rc - Browser name and version: firefox developer edition
87.0b9 - Link to your project: compiled through laravel mix