Skip to content

fix after call setMinMaxScaleX, when scaleX to bound value, chart wil… - #5391

Closed
renzhenfei wants to merge 2 commits into
PhilJay:masterfrom
renzhenfei:master
Closed

renzhenfei wants to merge 2 commits into
PhilJay:masterfrom
renzhenfei:master

Conversation

@renzhenfei

@renzhenfei renzhenfei commented May 19, 2023

Copy link
Copy Markdown

After call setMinMaxScaleX, when operate chart zoom, while scaleX or scaleY scale to max value or min value, the chart will jump.

PR Checklist:

  • I have tested this extensively and it does not break any existing behavior.
  • I have added/updated examples and tests for any new behavior.
  • If this is a significant change, an issue has already been created where the problem / solution was discussed: [N/A, or add link to issue here]
    Line data chart jumps during zoom #4489

PR Description

In default BarLineChartTouchListener file, when handle zoom event, source code just post scaleX or scaleY, no check after call postScale the scaleX or scaleY value is valid.

This change limit scale to minScale or maxScale when zoom.

@hannesa2

hannesa2 commented Aug 3, 2023

Copy link
Copy Markdown
Contributor

Please can you show a before-this-change and a after-this-change screenshot ?

@hannesa2

hannesa2 commented Aug 3, 2023

Copy link
Copy Markdown
Contributor

It will probably merged here AppDevNext/AndroidChart#138

@renzhenfei

renzhenfei commented Aug 7, 2023

Copy link
Copy Markdown
Author

@hannesa2
before

chart_before_cut.mp4

after

chart_after_cut.mp4

@hannesa2

hannesa2 commented Aug 7, 2023

Copy link
Copy Markdown
Contributor

@renzhenfei Thank you I'll merge it

@PhilJay

PhilJay commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Thank you. This is in 4.0.0-beta01: the pinch scale is limited before it is applied, so the chart no longer jumps when it reaches its scale limit. 4.0 is a rewrite in Kotlin, so the Java sources this patch touches no longer exist and it cannot be merged as it stands. It was reimplemented rather than merged, so the credit is yours.

https://github.com/PhilJay/MPAndroidChart/releases/tag/v4.0.0-beta01

@PhilJay PhilJay closed this Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants