Chart v3.0.0-rc.6: Missing Gridline right side....
See original GitHub issueExpected Behavior
The last gridline is not drawn on the right for all charts. Can I correct this through settings or is it a mistake?
Current Behavior
Possible Solution
???
Steps to Reproduce
see: http://www.ipscon.com/test/testcase1.html
Environment
- Chart.js version: v3.0.0-rc.6
- Browser name and version: any…
- Link to your project:
Issue Analytics
- State:
- Created 2 years ago
- Comments:32 (15 by maintainers)
Top Results From Across the Web
Display or hide chart gridlines - Microsoft Support
Click anywhere on the chart in which you want to hide chart gridlines. · On the Layout tab, in the Axes group, click...
Read more >javascript - Chart.js v2 - hiding grid lines - Stack Overflow
I found a solution that works for hiding the grid lines in a Line chart. Set the gridLines color to be the same...
Read more >Styling - Chart.js
Styling. There are a number of options to allow styling an axis. There are settings to control grid lines and ticks.
Read more >Troubleshooting: The Gridlines are Missing in Microsoft Excel
If you're not seeing the gridlines in Excel, first ensure that the gridlines box in View: Show/Hide is checked.
Read more >How to Add and Remove Gridlines in Excel Charts
Once the chart name area is highlighted, you will see the Chart Elements button next to upper right hand side of the chart....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kurkle
It happens only when scales
"type": "time"
all other charts works perfect.Testcase 1:
https://codepen.io/kurkle/pen/wvgzOYW
Edit CSS
Resize the browser window --> sometimes missing gridlines.
Testcase2:
@kurkle I’d expect it to work as it did in version 2.x - the rightmost border was always displayed in the previous major version without any tinkering.
I actually figured out a workaround:
The
callback
function ensures that the first (index === 0
) and last ticks (index === values.length - 1
) are always displayed. Forcing the last tick to display is the key to have the rightmost border show up. After some trial and error, I found that for my particular use case displaying every 4 ticks in between by using (index % 4 === 0
) gives me a consistent interval between ticks displayed.This is the result:
Regardless, in version 2 none of this was necessary as the rightmost border was always displayed, as most people would expect.