-
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
BUG: Graph is stick out when set min or max options to yAxes. #3506
Comments
Thanks for the detailed report. You can add some basic clipping by adding the following plugin to your chart Chart.plugins.register({
beforeDatasetsDraw: function(chartInstance) {
var ctx = chartInstance.chart.ctx;
var chartArea = chartInstance.chartArea;
ctx.save();
ctx.beginPath();
ctx.rect(chartArea.left, chartArea.top, chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);
ctx.clip();
},
afterDatasetsDraw: function(chartInstance) {
chartInstance.chart.ctx.restore();
},
}); |
This was referenced Nov 27, 2016
Merged
etimberg
pushed a commit
that referenced
this issue
Dec 3, 2016
exwm
pushed a commit
to exwm/Chart.js
that referenced
this issue
Apr 30, 2021
Implements clipping of items outside the chart area. Resolves chartjs#3506 chartjs#3491 chartjs#2873
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello. When I set min (or max) parameter to yAxes options in line chart, data which less than min value (or greater than max value) is sticked out from drawing area, and labels are overlayed with lines. It also occurs in bar chart.
I know when I set suggestedMin options to yAxes, y-axis labels are auto-scaled. But I want to hide data less than specified value. Is that a bug or can I get any solutions?
Expected Behavior
Values less than min or greater than max value are not displayed from drawing area, and labels are not overlayed with data.
Current Behavior
Steps to Reproduce (for bugs)
Environment
The text was updated successfully, but these errors were encountered: