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

Multiple-yaxis-scales, 3 series with 2 scales demo was broken by 3.47.0 #4331

Merged
merged 3 commits into from
Mar 19, 2024

Conversation

rosco54
Copy link
Contributor

@rosco54 rosco54 commented Mar 15, 2024

New Pull Request

Fixes relating to yaxis.seriesName array feature added at revision 3.47.0:

  1. The forward and reverse yaxis to series maps had errors.
  2. Anything that indexed into various global or context arrays (yaxis array, series working arrays, baseline or ratio arrays, etc), needed to be mapped through the new forward or reverse yaxis to series maps.

Fix historical issue with goals and annotations being drawn when the axis is hidden or outside the grid area when zoomed or panned, or where rectangular area annotation should be clipped.

Fix historical issue: baseLineY calculation not adjusted for logarithmic y axes.

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. Fix what may have been an historical issue with log charts and return 0 for negative or zero values passed to getLogVal(), not just values that equal 0. Negative values appear to cause the chart to misalign with the axis.
  4. wrong point annotation x position in sparkline chart.

Fixes #2757
Fixes #3073
Fixes #3421
Fixes #3553
Fixes #4081
Fixes #4241 (maybe)
Fixes #4323

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

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.

Miscellaneous:
Remove yaxis.min: 0 from the bar axes in sample as not required.
@rosco54
Copy link
Contributor Author

rosco54 commented Mar 15, 2024

This replaces the previous PR #4329 that was incorrectly based.

@rosco54 rosco54 marked this pull request as ready for review March 15, 2024 07:56
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[] that doesn't derive from realIndex needed to go
through w.globals.seriesYAxisMap.
Primarily affected y-axis annotations and possibly some other
positioned features in multi-axis charts.

Miscellaneous:
Remove yaxis.min: 0 from the bar axes in sample as not required.
@rosco54 rosco54 marked this pull request as draft March 16, 2024 06:32
@rosco54 rosco54 force-pushed the Issue_4323_rebased branch 4 times, most recently from 1961859 to 9361838 Compare March 19, 2024 02:34
@rosco54
Copy link
Contributor Author

rosco54 commented Mar 19, 2024

@junedchhipa Can you give me a clue re the baseLineY value that is used in translating into SVG grid coordinate space. I haven't been able to determine how that value is derived but it throws out the alignment of logarithmic plots and yet is ok for linear plots. At the moment I'm just substituting zero for log plots.

Update: It's ok. I've got it, and have fixed the root problem. baseLineY is now adjusted for logarithmic yaxes.

@rosco54 rosco54 marked this pull request as ready for review March 19, 2024 11:38
@rosco54 rosco54 marked this pull request as draft March 19, 2024 11:43
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 rosco54 marked this pull request as ready for review March 19, 2024 12:45
@junedchhipa junedchhipa merged commit 733b080 into apexcharts:main Mar 19, 2024
@rosco54 rosco54 deleted the Issue_4323_rebased branch May 5, 2024 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment