Prevent bezier points from being capped when a data point is off the chart#5937
Prevent bezier points from being capped when a data point is off the chart#5937simonbrunel merged 3 commits intochartjs:masterfrom
Conversation
| var area = me.chart.chartArea; | ||
| var points = (meta.data || []); | ||
| var lineModel = meta.dataset._model; | ||
| var area = chart.chartArea; |
There was a problem hiding this comment.
I might call this chartArea to be a little clearer. And I think model would probably be fine for the previous variable. But I don't feel strongly about either
There was a problem hiding this comment.
model is used to keep point._model later, so this needs to be a different name.
There was a problem hiding this comment.
I prefer area, which I think is clear enough in that context. I also prefer model but as you said it's already taken.
benmccann
left a comment
There was a problem hiding this comment.
This looks good to me though someone more familiar with the bezier stuff should probably take a look as well
| var area = me.chart.chartArea; | ||
| var points = (meta.data || []); | ||
| var lineModel = meta.dataset._model; | ||
| var area = chart.chartArea; |
There was a problem hiding this comment.
I prefer area, which I think is clear enough in that context. I also prefer model but as you said it's already taken.
#5265 reported that horizontal lines appear in a chart. When I tried to skip the clipping for lines, I noticed that lines drawn off the chart have bezier control points on the y axis, and some lines overflow into the chart area.
This PR fixes this issue by preventing bezier points from being capped when a data point is off the chart.
Version 2.7.3: https://jsfiddle.net/nagix/e40qgfzs/
Master + This PR: https://jsfiddle.net/nagix/h8dp4ft6/
Fixes #5265