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] Wrong category size of Bar with min ,max options.

See original GitHub issue

Hi! thank you for provide excellent chart library. I would like to report some issue.

Current Behavior

With min (or max) option, Category size probably calculated from the total number of labels, not the number of labels displayed. Then, the size of bar will be smaller and shift ,even though categoryPercentage and barPercentage is 1. (also Issues #3506 plugin added)

report-chartjs-wrongcategorysize

Steps to Reproduce (for bugs)

jsfiddle

  1. Chart type is “bar”
  2. Set min or max, both also.
  3. When executed, the bar position will be smaller and shift left. (You can see easily when categoryPercentage and barPercentage is 1 )
  4. line is work.

Environment

Chart.js version : 2.4.0 Browser name and version : Microsoft Edge 38.14393.0.0 Link to my project : https://jsfiddle.net/d29yoL8u/5 Added Issues #3506 duplicate of #3491 and #2870

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
etimbergcommented, Nov 17, 2016

@Jareechang please open another issue for the tooltip issue

1reaction
KoyoSEcommented, Nov 17, 2016

Probably, I think this problem can be solved with this correction.

Possible Solution

Delete the following two codes.

https://github.com/chartjs/Chart.js/blob/master/src/controllers/controller.bar.js#L142-L145

https://github.com/chartjs/Chart.js/blob/master/src/controllers/controller.bar.js#L469-L472

With this fix, it becomes as follows.

2016-11-18 2016-11-18 2

jsfiddle

Environment

Chart.js version : 2.4.0 Browser name and version : Microsoft Edge 38.14393.0.0 Link to my project : https://jsfiddle.net/2eq6jxL7/

(I have poor English. so I am sorry if I am rude.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

<fieldset> resizes wrong; appears to have unremovable `min ...
I want the <select> to resize so it is never wider than its parent, even if it has to cut off its displayed...
Read more >
10 Most Common Bootstrap Mistakes That Developers Make
We will take a look at 10 of the most common Bootstrap mistakes, problems, ... top: 0; right: 0; min-width: 100%; min-height: 100%;...
Read more >
Bug descriptions — spotbugs 4.7.3 documentation
This document lists the standard bug patterns reported by SpotBugs. ... order of the constants is incorrect: it should be Math.min(100, Math.max(0, value))....
Read more >
A Complete Guide to Histograms | Tutorial by Chartio
Each bar typically covers a range of numeric values called a bin or class; ... Top: carelessly splitting the data into ten bins...
Read more >
Tab bars - Navigation and search - Human Interface Guidelines
Tabs represent an app's menu of options. Tabs titled “Home” tend to be too large in scope for an app. Aim to create...
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