Skip to content
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] (vertical) stacked bar is created without respecting ticks.min setting #4071

Closed
cizmiak opened this issue Mar 24, 2017 · 1 comment
Closed

Comments

@cizmiak
Copy link
Contributor

cizmiak commented Mar 24, 2017

Expected Behavior

When stacked yAxis.ticks.min is set chart should also be cut by this horizontal line like line chart type is.

Current Behavior

Whole value of bar is added to yAxis.ticks.min so that resulting bar has value = barDataValue + yAxis.ticks.min.

Possible Solution

Silly workaround is to substract data values with minimum value, hide yAxis for dataset and display results with dummy yAxis with properly ticks.min and max set:
https://jsfiddle.net/24aotbnc/20/

Steps to Reproduce (for bugs)

https://jsfiddle.net/24aotbnc/19/

  1. dataset.type = 'bar'
  2. dataset.data = set some data
  3. yAxis.stacked = true
  4. yAxis.ticks.min = minimum

Context

Imagine you have stacked bars, bottom bars are bad(red) and top bars are good(green). All bottom red bars have value 80. All top green bars have vallue between 0 and 20. So may be you want to focus on values between 70 and 100.

Environment

  • Chart.js version: 2.5
@etimberg
Copy link
Member

@cizmiak thanks for reporting this. We actually noticed this too. It got fixed in #4010

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants