question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] 2.7.0 hides/clips part of chart

See original GitHub issue

Note: I think it’s a different problem than #4759. That problem might have to do with total chart padding and this doesn’t (I’ve tested). Here, specifically the top of a <Line> chart is getting clipped/cut off early.

Expected Behavior

Should be able to see items on all sides of the chart, as it was working in v2.6: v2_6

Current Behavior

Once updating to v2.7, the top of the chart gets cut off: v2_7

Possible Solution

Edit: So far, the padding I’ve been able to add is to the outside of the whole chart, not to just an axis itself. I’ll keep looking for a way to do that. I think you can add extra padding to make it work, but is this the indended behavior to start with? Is that the intended solution? Is the chart being created incorrectly (see below)? If so, it’s not a bug, but then a note about padding could be added to the docs because it seems non-obvious. To be fair, maybe it’s there and I didn’t see it.

Steps to Reproduce (for bugs)

A link to the gh-pages live example would be useless because that code is going to change, but here’s a pastebin of the current code:

https://pastebin.com/yeBLmXiU

Context

I’m not sure if it’s relevant, but it’s meant to be a graph showing effects of income on various other factors.

Environment

  • Chart.js version: 2.7
  • Browser name and version: Chrome 61.0.3163.100
  • Link to your project: Again, the project code is not going to stay the same

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
jcopperfieldcommented, Oct 30, 2017

The bug is caused by the introduction of the lineHeight (defaults=1.2) parameter for the title. This causes the title box to have a decimal height (default: 34.4px), which due to not rounding values clips the top line of the graph.

Workaround Set title lineHeight option to 1.

Proposed fix fix_#4790_BUG_2-7-0_hides_clips_part_of_chart.patch.txt

3reactions
sunweiyangcommented, May 30, 2018

@tenznhok Looks like the bug still isn’t fixed. I still have to use @jcopperfield’s lineHeight: 1 workaround to avoid this problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Possible Statistics Chart Bug in 3+ - Esri Community
When you right click on the attribute column to compute statistics (screen shot) The statistics panel no longer computes statistics for the ...
Read more >
changeLog.txt
Fired every time chart is drawn - on zoom, hide graph, etc. bug fixed - in some ... allows marking desired area with...
Read more >
[CI] Review environments failing: `NoMethodError: undefined ...
The error in https://gitlab.com/gitlab-org/charts/gitlab/-/jobs/3341167687#L26934 shows: NoMethodError: undefined method `can_create_group' ...
Read more >
2008 Topps Baseball Series 2 Checklist Clipart - numama.ru
BUG] 2.7.0 hides/clips part of chart · Issue #4790 · chartjs/Chart.js · GitHub. FLAKE: //test/core/slice:slice_test for C++ on Windows · ...
Read more >
Version History - JIDE Software
(Charts) Fixed NPE in the Chart. See the bug report here. October 28, 2018 - 3.7.5 (Regular Release, changes from 3.7.4).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found