Apexcharts.js: Any click on chart button makes the page scrol to top

Created on 7 Aug 2020  路  5Comments  路  Source: apexcharts/apexcharts.js

Bug report

There is my diagram :
image

Explanation

  • What is the behavior you expect?
    When I click for example on a line label, the line should disappear and nothing more should happen.
  • What is happening instead?
    The line disappear but the page automatically scrolls up for no reason. This not happen only when I click on a label but also when I click on the zoom in/out buttons and so on.
  • What error message are you getting?
    I'm getting no error message.
bug high-priority

Most helpful comment

Thanks for reproducing it. I will take a look soon.

All 5 comments

Can you reproduce this in a codepen?

Can you reproduce this in a codepen?

Might be a little complicated, my whole chart is automated by database queries and twig variables (I work under Symfony 5). Tell me what else can I do ?

I have the same problem: Here is my code sandbox which reproduces it: https://codesandbox.io/s/react-apexcharts-bar-show-hide-serie-x35jt?file=/src/App.js

You just have to make the window small enough so that there are scroll bars, scroll to the bottom, activate/deactive legends. It scroll to the top each time the chart renders.

I am experiencing the same problem with one of my applications where I have a chart that updates on a timer. On every update, it scrolls the page to the top. (https://github.com/fredli74/smartcharge-dev/issues/159)

This was a bug introduced in Apexcharts version 3.19.3, my workaround has been pinning the version to 3.19.2 in my package.json file.

I tested it in your codesandbox and it seems to solve the click problem as well.

"apexcharts": "3.19.2",

Thanks for reproducing it. I will take a look soon.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

felixalguzman picture felixalguzman  路  3Comments

artfulrobot picture artfulrobot  路  3Comments

ismaildervisoglu picture ismaildervisoglu  路  3Comments

tcarlsen picture tcarlsen  路  3Comments

rudeayelo picture rudeayelo  路  3Comments