-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent bezier points from being capped when a data point is off the chart #5937
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
model
is used to keep point._model
later, so this needs to be a different name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer area
, which I think is clear enough in that context. I also prefer model
but as you said it's already taken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer area
, which I think is clear enough in that context. I also prefer model
but as you said it's already taken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nagix
#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