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

Mixed chart y-axis scaling issue (with stacked true) #1371

Closed
vincemat opened this issue Mar 9, 2020 · 9 comments
Closed

Mixed chart y-axis scaling issue (with stacked true) #1371

vincemat opened this issue Mar 9, 2020 · 9 comments

Comments

@vincemat
Copy link

vincemat commented Mar 9, 2020

Bug report

Codepen

Please look at this codepen.

Explanation

  • What is the behavior you expect:
    I expect the y-axis to be set (near) to the max value (sum of area data or highest value of line data)
  • What is happening instead:
    The y-axis is scaled based on the sum of the area + line data which lead to a wrong scaling of the chart
  • What error message are you getting:
    No error message, just a question of visualisation of data
@JohnRomanski
Copy link

I think all 3 need to be area to stack

https://codepen.io/vincemat/pen/dyoJzjj

          name: 'TEAM B',
          type: 'area',

@vincemat
Copy link
Author

vincemat commented Apr 3, 2020

Yes, I understand that the scaling is based on the stacked of the 3 but in my case I would like to have a mixed chart (line+area stacked) without the scaling being the sum of the three but the max(A+C, B)...

@JohnRomanski
Copy link

What you are expecting makes sense now, maybe you can add that to the issue description?
In terms of your request, this seems to be an outstanding bug based on #26 (comment)

@Adriien-M
Copy link

Adriien-M commented Dec 7, 2020

@vincemat did you find any workaround to solve this issue?
Edit: the only solution for now is to specify max option in yAxis properties

@vincemat
Copy link
Author

vincemat commented Dec 7, 2020

Indeed, the only solution is to specify a max option in yAxis properties...

@oliveli
Copy link

oliveli commented Jun 9, 2021

Setting a fixed max value doesn't work in all cases, since with it you loose the charts ability to dynamic adjust the Y-axis when a series is hidden via clicking the legend.

So IMHO it would be best to calculate Y-Axis max value like this:

  • determine max-value of each data series (i.e. line/area/bar) in the chart
  • if type (line/area/bar) is stacked: calculate sum of max-value of all series of the same type
  • if type is not stacked: determine max max-value of all series of the same type
  • set y-Axis.max to max of all max-values of each series type

best regards

@iameddz
Copy link

iameddz commented Jul 19, 2021

I have the same problem. Has anyone already found a workaround (without loosing the ability to dynamic adjust the Y-axis)?
Issue #531 from 2019 had already described the same behavior.

@vincemat
Copy link
Author

vincemat commented Sep 8, 2021

I did not find any workaround yet... But I'm totally open to any idea because I'm quite stuck with this...

@github-actions
Copy link

github-actions bot commented Nov 7, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

5 participants