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
Hi! I'm trying to change options of specific points in my dataset, but when I change the options of an individual point, the options of the other points also change, like they are sharing the options.
What can I do? The lib have some kinda method that update an individual element? An individual point?
The problem
First of all: English is not my native language, I hope you guys understand my question.
What i'm trying to do is a "one row gantt chart", to do that, I created five datasets, each representing one condition in the time, when the condition in time not happens, i set x and y to NaN, doing that chartjs dont draw a line, also spanGaps is not set to true. And to draw a bar insted of a line, I've setted the border width to 40.
The result is shown in the figure below.
Observing the figure, we see a lot of white gaps, those white gaps are lonely points, zooming the chart we note that (figure below).
What i've tried to to is: find every lonely point (checking if the previous and next points are null and if my current point isn't null), the reason for the y===0 is because all points of dataset are constant = 0, the only axis that change is X (time type). Then I set the individual point to be a vertical line of radius/hoverRadius equals to 20, with this the point becomes the height of the "fake bar". Below is my piece of code.
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summarizing
Hi! I'm trying to change options of specific points in my dataset, but when I change the options of an individual point, the options of the other points also change, like they are sharing the options.
What can I do? The lib have some kinda method that update an individual element? An individual point?
The problem
First of all: English is not my native language, I hope you guys understand my question.
What i'm trying to do is a "one row gantt chart", to do that, I created five datasets, each representing one condition in the time, when the condition in time not happens, i set x and y to NaN, doing that chartjs dont draw a line, also spanGaps is not set to true. And to draw a bar insted of a line, I've setted the border width to 40.
The result is shown in the figure below.
Observing the figure, we see a lot of white gaps, those white gaps are lonely points, zooming the chart we note that (figure below).
What i've tried to to is: find every lonely point (checking if the previous and next points are null and if my current point isn't null), the reason for the y===0 is because all points of dataset are constant = 0, the only axis that change is X (time type). Then I set the individual point to be a vertical line of radius/hoverRadius equals to 20, with this the point becomes the height of the "fake bar". Below is my piece of code.
Doing that, the WHOLE dataset points options changed, I've noticed this after log the dataset again or just seeing the chart result:
I also tested the code fragment below to check if changing only one point, the whole dataset points changes, and they did.
Beta Was this translation helpful? Give feedback.
All reactions