-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Possible Bug] Bar Chart doesn't display right border #3804
Comments
This works for the line chart because there is a tick mark right at the end. In the bar chart, the labels are shifted into the center and there is no line at the end. Should be a relatively easy fix to draw one more line in that case. This case is when |
It does add the gridline, but that solution won't work since it breaks into the padding of the graph. It also doesn't line up very well. I could write my own plugin to just draw a line there if the type is 'bar' but i'd think there would be a way to put a border there without breaking into the padding. Modified Config
|
The lines to draw get added here What probably needs to happen is that the category axis only (https://github.com/chartjs/Chart.js/blob/master/src/scales/scale.category.js) needs to draw one extra line after the base class implementation has finished. An alternative solution is that we generally draw a border around the chart area and do that separately from the axes |
I got ya, I haven't messed much with multiple same dimension Axes charts so other than a different border property I'm not sure how people with that criteria would like to handle it. A separate border property that only draws if defined and it defaults to undefined makes the most sense to me, off the top of my head though I haven't looked much into it. Writing a modification for that would be simple enough if there was an agreed upon data setup (border I'd expect in the options.chartArea.border. I'd personally vote for separate border property that defaults to the same colors as the Axes. I'll do a pull request and see what people think, as if it modified project code you'd need more feature options like rounding, strokeWidth, joins, etc. For now I'm just using the primary xAxes color so the left & right match with the plugin below to fix the issue.
|
I think I'm happy to look at a PR for this. 😄 |
Has there been any movement on this? I'm creating a line graph with offset data and offset labels on my yAxes, but the bottom border will not display.
If I remove the 'offsetGridLines' and 'offset' properties the bottom border displays fine. |
Any idea as to what the fix might be in 3.x? I'm currently running 3.7 and running into the exact same issue. Docs don't seem to mention chart area border as a setting anywhere. I've seen some stackoverflows that mention chartAreaBorder as a plugin but autocomplete and other docs suggest that is not the case. |
I'm building a bunch of charts for my project and I just noticed an oddity in vertical bar graphs I am not seeing in line charts. The bar charts don't display the right border. I have tried placing 'drawBorder: true' in both Axes but nothing has changed. Is this a bug or am I missing something in the documentation?
Below is my config for the graph
Notice the line chart with no settings altered for the borders works fine
In fact the bar chart in the documentation has the same issue.

The text was updated successfully, but these errors were encountered: