Line chart - adjusted line width of specific segment #9398
Unanswered
PavolSvidran
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I think https://www.chartjs.org/docs/latest/samples/line/segments.html is what you need to use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there, i need to achieve one special functionality of the line chart.
Chart where x-axis is of time type and y-axis is numeric shows a frequented data. Its border is set to some low value (0.05 - almost invisible) and fill flag is enabled.
Situation is that i need to adjust border of line to e.g. 1 width when y value of both points forming a line is equal to value zero. The line is on xAxis and forming line of default width means that it is invisible because there is no filled area.
In older version of chartJS (2.9.2) i used not the best method, which was override of draw function in Line prototype.
In newest version 3.4.1 it is a little complicated (functionality is divided into multiple functions, not visible in prototype, etc..) and override solution is not a good practice - a lot of work after updates.
Conclusion: i need to reach functionality descibed above with overides as little as possible.
Do you have any ideas how do it thought config, custom made plugin, etc?
Beta Was this translation helpful? Give feedback.
All reactions