apexcharts.js icon indicating copy to clipboard operation
apexcharts.js copied to clipboard

Safari: legend position will offset when zoom in

Open busyxiang opened this issue 3 years ago • 17 comments

Description

Safari browser will offset legends when zoom in

Steps to Reproduce

  1. Open Safari browser
  2. Open any demo charts with legends
  3. Zoom in

Expected Behavior

The legends' position should not offset when zoom in

Actual Behavior

The legends' position offset when zoom in

Screenshots

Screenshot 2022-02-10 at 2 24 43 PM

Reproduction Link

https://apexcharts.com/javascript-chart-demos/column-charts/basic/

busyxiang avatar Feb 10 '22 06:02 busyxiang

@busyxiang Were you able to find a workaround or fix for this at all?

ryanklenk avatar Apr 13 '22 12:04 ryanklenk

@ryanklenk nope, still waiting for the dev team to fix this

busyxiang avatar Apr 13 '22 14:04 busyxiang

I do not know how to account for the discrepancy between where Safari thinks the legend elements are located and where they are rendered. In this example, Safari is indicating the bounding box of the black circle on the first legend item.

Screen Shot 2022-05-16 at 10 22 07 AM

We are currently testing .apexcharts-svg .apexcharts-legend { position: fixed !important; } as a quick and dirty workaround. The legend does not scale to width so it is not centered at different zoom levels, but it is at least at the correct position vertically.

idpaterson avatar May 16 '22 16:05 idpaterson

Any progress on this? This is an annoying bug plaguing lots of apex charts users. Possibly moving out the legend from SVG or using idpaterson's workaround.

oootkarsh avatar Apr 06 '23 15:04 oootkarsh

I'm not seeing this glitch anymore. The CSS workaround is still in place in my implementation but it no longer has any effect because the legend has been moved outside of the SVG. Currently using apexcharts 3.37.2, perhaps it was fixed by 088ed12 which was included in 3.37.1

idpaterson avatar Apr 06 '23 15:04 idpaterson

Indeed, looks like 3.37.1 fixed it. Check out this codepen with Safari in 3.36.1 where the legend bug still existed on page zoom in/out vs 3.37.2 which seems to be fixed.

idpaterson avatar Apr 06 '23 15:04 idpaterson

Due to the feedback from the community, this appears to have been fixed and is no longer an issue. I will be closing it as fixed.

brianlagunas avatar Apr 06 '23 21:04 brianlagunas

I can see the issue fixed in Version 3.37.2, but seems like some regression happened between 3.37.2 to 3.41.0 as I can see it started happening again.

Can somebody please look into it?

cc: @brianlagunas

VaibhavTessell avatar Jul 10 '23 01:07 VaibhavTessell

@busyxiang / @brianlagunas Can you please reopen this thread as I can see the issue getting reproducing in Version 3.41.0 ? Thank you!

VaibhavTessell avatar Jul 11 '23 19:07 VaibhavTessell

@busyxiang / @brianlagunas Can you please reopen this thread as I can see the issue getting reproducing in Version 3.41.0 ? Thank you!

Do you have a codepen proving this?

brianlagunas avatar Jul 11 '23 22:07 brianlagunas

Do you have a codepen proving this?

Link to the codepen with 3.41.0 version: https://codepen.io/Vaibhav-Singh-the-bold/pen/BaGJmjx

cc: @brianlagunas

VaibhavTessell avatar Jul 12 '23 06:07 VaibhavTessell

Same error goes for zoom out in safari. Legend comes out of the div when zoom out. image

mervekaraman avatar Jul 27 '23 12:07 mervekaraman

Is there any way to solve this problem?

DmitryKhiliuk avatar Feb 21 '24 15:02 DmitryKhiliuk