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

Duplicate y axis values #410

Closed
victorgdb opened this issue Mar 19, 2019 · 9 comments
Closed

Duplicate y axis values #410

victorgdb opened this issue Mar 19, 2019 · 9 comments
Labels
bug Something isn't working

Comments

@victorgdb
Copy link

victorgdb commented Mar 19, 2019

Codepen

https://codepen.io/anon/pen/NJBLgv

Explanation

  • What is the behavior you expect?
    Y axis should not have duplicated values
  • What is happening instead?
    1 and 4 are duplicated
  • What error message are you getting?
    No error message

Have I misunderstood something?
Thanks for your help!

Update: It seems to be related to the default tickAmount of 6. It would be great if the chart could know itself how to reduce this tickAmount number if there isn't enough data to display 6 points.

@junedchhipa junedchhipa added the bug Something isn't working label Mar 19, 2019
@junedchhipa
Copy link
Contributor

Yeah, you're correct. The y-axis should automatically reduce the tickAmount if the range is too small to print non-duplicating round numbers.

@sheikh303
Copy link

sheikh303 commented Feb 18, 2021

this could be a work around here:
yaxis: { min: 0, max: _maxYAxisValue_ + _offset_, tickAmount: _maxYAxisValue_+ _offset_, }

@nayanadas
Copy link

nayanadas commented Mar 5, 2021

@sheikh303 @junedchhipa how to avoid duplicate y-axis label values in real-time chart without setting min or max or tickAmount, will the labels automatically set based on the y-axis value?

image (4)

@sheikh303
Copy link

@sheikh303 @junedchhipa how to avoid duplicate y-axis label values in real-time chart without setting min or max or tickAmount, will the labels automatically set based on the y-axis value?

image (4)

Y-axis doesn’t provide showDuplicate: false configuration. Only X-axis has it.
Using "Min, max, tickAmount" is only work around i guess.

@nayanadas
Copy link

@sheikh303 ok thanks for confirming

@Teyken
Copy link

Teyken commented Aug 12, 2022

Any news on this?
We have some pretty complex charts, so the workaround is very difficult to implement.

@ephraimlambarte
Copy link

this still happens in my line chart. my apexcharts version: 3.35.5

@kwalk2108
Copy link

kwalk2108 commented Oct 13, 2022

this could be a work around here: yaxis: { min: 0, max: _maxYAxisValue_ + _offset_, tickAmount: _maxYAxisValue_+ _offset_, }

@sheikh303 Could you please expand on how the maxYAxisValue and offset are set? Are these values statically assigned because I don't think in any of those chart options, we have access to the y values to dynamically determine what those values should be.

@rocso
Copy link
Contributor

rocso commented Jan 8, 2024

Please see; #3974 (comment)

I have this problem using the Apexcharts card in Home Assistant. Increasing the yaxis decimals value was one solution as, by observation only, it appears as if the grid/ticks are drawn to values proportionate to their spacing between the max/min values but the labelling of those values is simply rounded to the nearest decimals specification for labelling. I tried varying tickAmount also and observed that, although the grid/ticks were evenly spaced, the labelling was not duplicated but also not proportionate. E.g. in the image, the grid is evenly spaced and clearly the label increments: 0.03, 0.04, 0.03, are not proportional.

Apexgraph-bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants