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

Annotations overflow onto y-axis #2757

Closed
Labels
bug Something isn't working verified

Comments

@jenniarg21
Copy link

Description

I created a timeline chart with a date range slider however I found a bug. My timeline chart has annotations and goal lines. I'm using the zoomX() method on the range slider to adjust the zoom bounds. Whenever the annotations and/or goal lines are outside of the starting zoomX() minimum value, they will overflow and overlap the y-axis labels (if it passes the width of the y-axis labels, it will not show as is intended). I tested this out in a line chart and it work as intended; my assumption is that this only occurs when the x-axis is of type 'datetime'.

Steps to Reproduce

  1. Add an annotation or goal on a timeline chart.
  2. Use the zoomX() method to zoom in to the chart so that the annotation/goal line is no longer within the minimum bounds of the zoom.

Expected Behavior

Annotations and goals should not be visible when they are over the minimum zoom x-axis value.

Actual Behavior

Annotations and goals are visible and overlap the y-axis labels.

Screenshots

image

Reproduction Link

Here's a codepen with simplified code showing the bug:
https://codepen.io/jenniarg21/pen/mdMLpjX

@jenniarg21 jenniarg21 added the bug Something isn't working label Nov 8, 2021
@mrdannyjohnson
Copy link

Hey @jenniarg21, I'm experiencing the same issue, with point annotations visible outside the bounds of the chart. Did you manage to resolve it?

@jenniarg21
Copy link
Author

Hey @mrdannyjohnson, unfortunately not 😕 If you find any resolutions, please do share!

@jenniarg21
Copy link
Author

I looked into SVG masking but that didn't work out completely--SVG is new to me, but what crashed the code was when the graph was refreshed.

Anyone have any luck in a solution for this?

rosco54 added a commit to rosco54/apexcharts.js that referenced this issue Mar 19, 2024
…charts#4323

Multiple-yaxis-scales, 3 series with 2 scales demo was broken
by 3.47.0 after the introduction of the new yaxis:seriesName as an
array feature. Refactored some of that code.

Fixes relating to yaxis.seriesName array feature added to 3.47.0.
Anything that indexes into minYArr[], maxYArr[], baseLineY[],
xyRatios.yRatio[], etc, that doesn't derive from realIndex needed to
map the index through w.globals.seriesYAxisMap[seriesIndex].
Primarily affected y-axis annotations and possibly some other
positioned features in multi-axis charts.

Fix historical issue with goals and annotations being drawn when the
axis is hidden or drawn outside the grid area when zoomed or panned,
or where rect area annotation should be clipped. apexcharts#3073 apexcharts#3553 apexcharts#2757

Miscellaneous:
1) Remove yaxis.min: 0 from the bar axes in sample as not required.
2) Fix several calls to CoreUtils.getLogVal(b,d,seriesIndex) that
were missing the 'b' (base) argument.
3) in getYLogValue(): return  zero if 'd' <= 0 (was 'd' == 0). This may
fix apexcharts#4241.
4) wrong point annotation x position in sparkline chart fix apexcharts#4081.
rosco54 added a commit to rosco54/apexcharts.js that referenced this issue Mar 19, 2024
by 3.47.0 after the introduction of the new yaxis:seriesName as an
array feature. Refactored some of that code.

Fixes relating to yaxis.seriesName array feature added to 3.47.0.
Anything that indexes into minYArr[], maxYArr[], baseLineY[],
xyRatios.yRatio[], etc, that doesn't derive from realIndex needed to
map the index through w.globals.seriesYAxisMap[seriesIndex].
Primarily affected y-axis annotations and possibly some other
positioned features in multi-axis charts.

Fix historical issue with goals and annotations being drawn when the
axis is hidden or drawn outside the grid area when zoomed or panned,
or where rect area annotation should be clipped. apexcharts#3073 apexcharts#3553 apexcharts#2757

Miscellaneous:
1) Remove yaxis.min: 0 from the bar axes in sample as not required.
2) Fix sample syntax not parsed by e2e test harness.
3) Fix several calls to CoreUtils.getLogVal(b,d,seriesIndex) that
were missing the 'b' (base) argument.
4) in getYLogValue(): return  zero if 'd' <= 0 (was 'd' == 0). This may
fix apexcharts#4241.
5) wrong point annotation x position in sparkline chart fix apexcharts#4081.
rosco54 added a commit to rosco54/apexcharts.js that referenced this issue Mar 19, 2024
by 3.47.0 after the introduction of the new yaxis:seriesName as an
array feature. Refactored some of that code.

Fixes relating to yaxis.seriesName array feature added to 3.47.0.
Anything that indexes into minYArr[], maxYArr[], baseLineY[],
xyRatios.yRatio[], etc, that doesn't derive from realIndex needed to
map the index through w.globals.seriesYAxisMap[seriesIndex].

Fix historical issue with goals and annotations being drawn when the
axis is hidden or drawn outside the grid area when zoomed or panned,
or where rect area annotation should be clipped. apexcharts#3073 apexcharts#3553 apexcharts#2757

Fix historical baseLineY not being scaled correctly for logarithmic
yaxis.

Miscellaneous:
1) Remove yaxis.min: 0 from the bar axes in sample as not required.
2) Fix sample syntax not parsed by e2e test harness.
3) Fix several calls to CoreUtils.getLogVal(b,d,seriesIndex) that
were missing the 'b' (base) argument.
4) in getYLogValue(): return  zero if 'd' <= 0 (was 'd' == 0). This may
fix apexcharts#4241.
5) wrong point annotation x position in sparkline chart fix apexcharts#4081.
rosco54 added a commit to rosco54/apexcharts.js that referenced this issue Mar 19, 2024
by 3.47.0 after the introduction of the new yaxis:seriesName as an
array feature. Refactored some of that code.

Fixes relating to yaxis.seriesName array feature added to 3.47.0.
Anything that indexes into minYArr[], maxYArr[], baseLineY[],
xyRatios.yRatio[], etc, that doesn't derive from realIndex needed to
map the index through w.globals.seriesYAxisMap[seriesIndex].

Fix historical issue with goals and annotations being drawn when the
axis is hidden or drawn outside the grid area when zoomed or panned,
or where rect area annotation should be clipped. apexcharts#3073 apexcharts#3553 apexcharts#2757

Fix historical baseLineY not being scaled correctly for logarithmic
yaxis.

Miscellaneous:
1) Remove yaxis.min: 0 from the bar axes in sample as not required.
2) Fix sample syntax not parsed by e2e test harness.
3) Fix several calls to CoreUtils.getLogVal(b,d,seriesIndex) that
were missing the 'b' (base) argument.
4) in getYLogValue(): return  zero if 'd' <= 0 (was 'd' == 0). This may
fix apexcharts#4241.
5) wrong point annotation x position in sparkline chart fix apexcharts#4081.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment