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

Axis scaling enhancements #4284

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

rosco54
Copy link
Contributor

@rosco54 rosco54 commented Feb 29, 2024

New Pull Request

  • When chart is type 'bar', ensure reference to zero base is maintained when zoomed and auto scaling the Y axis.

  • When forceNiceScale = true, set default ticks based on SVG size.

  • Final stage tick culling in Scales.niceScale() is no longer conditional on forceNiceScale = true. This may result in the number of ticks being unexpectedly reduced to just one but is preferable to excessive ticks causing overlapping labels, or a reasonable number of ticks with very unhelpful intervals. For example, setting a max of 365 (prime factors of 5 and 73), with data that ranges from near zero would mean that 5 is the only possible "nice" tick interval producing 73 ticks in total. Because 73 is prime it cannot be reduced in number without introducing labelling that is less useful than none at all.

  • Collapsed series handling:

  1. The series YAxis map now represents both single axis and multiple axes charts so that collapsed series consistently and correctly determine axis visibility in both kinds of charts.

  2. Axis hiding now works for mixed multi-axis charts that include stacked series. Previously this was excluded for any chart.stacked: true.

  3. Fix a detail that was prematurely hiding axes if series were not available to assign to an axis, e.g. until loaded via chart.updateSeries().

  4. Use the first visible axis to render grid ticks. Previously ticks were always rendered based exclusively on the yaxis[0] regardless of it's hidden status.

  5. Fix for:
    RangeArea Chart: hide all series results in a crash RangeArea Chart: hide all series results in a crash #3984
    Deselecting all series in a rangeArea graph results in an error Deselecting all series in a rangeArea graph results in an error #4297

  • Tweaked some sample charts for improved presentation.

Fixes #4263
Fixes #4297
Fixes #3984

Type of change

  • New feature (non-breaking change which adds functionality)

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

@rosco54 rosco54 marked this pull request as draft March 2, 2024 02:53
@rosco54 rosco54 force-pushed the NiceScale_enhancements branch 2 times, most recently from a6beb92 to 0e5c42a Compare March 5, 2024 10:41
@rosco54 rosco54 marked this pull request as ready for review March 5, 2024 10:55
@rosco54 rosco54 marked this pull request as draft March 6, 2024 05:07
@rosco54 rosco54 marked this pull request as ready for review March 6, 2024 06:25
@rosco54 rosco54 marked this pull request as draft March 7, 2024 09:43
when zoomed and auto scaling the Y axis.

When forceNiceScale = true, set default ticks based on SVG size.

Collapsed series handling:
1) The series YAxis map now represents a single axis as well
as multiple axes so that collapsed series correctly manage axis
visibility there also in both types of charts.

2) Axis hiding now works for mixed charts that include stacked series.

3) Fix a detail that was prematurely hiding axes if series were not
available to assign to an axis until loaded via chart.updateSeries.

4) Use the first visible axis to render the grid ticks.

Tweaked some sample charts for improved presentation.
when there is scope to do so.

2) When chart is type 'bar', ensure reference to zero is maintained
when zoomed and auto scaling the Y axis.
when zoomed and auto scaling the Y axis.

When forceNiceScale = true, set default ticks based on SVG size.

Collapsed series handling:
1) The series YAxis map now represents a single axis as well
as multiple axes so that collapsed series correctly manage axis
visibility there also in both types of charts.

2) Axis hiding now works for mixed charts that include stacked series.

3) Fix a detail that was prematurely hiding axes if series were not
available to assign to an axis until loaded via chart.updateSeries.

4) Use the first visible axis to render the grid ticks.

5) Fix for:
RangeArea Chart: hide all series results in a crash apexcharts#3984
Deselecting all series in a rangeArea graph results in an error apexcharts#4297

Tweaked some sample charts for improved presentation.
@rosco54 rosco54 marked this pull request as ready for review March 7, 2024 11:00
@junedchhipa junedchhipa merged commit 0b95446 into apexcharts:main Mar 7, 2024
@rosco54 rosco54 deleted the NiceScale_enhancements branch March 15, 2024 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants