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

y-labels position is wrong,when i set autoScaleMinMaxEnabled = YES #2379

Closed
KevinZK opened this issue Apr 20, 2017 · 8 comments
Closed

y-labels position is wrong,when i set autoScaleMinMaxEnabled = YES #2379

KevinZK opened this issue Apr 20, 2017 · 8 comments

Comments

@KevinZK
Copy link

KevinZK commented Apr 20, 2017

i set autoScaleMinMaxEnabled = YES ,scaleYEnabled = NO and scaleXEnabled = YES, i set "setVisibleXRangeMaximum"and "setVisibleXRangeMinimum" after it have data. y-labels position is wrong, i must touch View or scale view to make it correct position。i don't know is this a bug, or i don't use it correctly。
Look forward to your reply

@liuxuan30
Copy link
Member

liuxuan30 commented Apr 21, 2017

can you explain y-labels position is wrong with a screenshot?

@KevinZK
Copy link
Author

KevinZK commented Apr 21, 2017

right
wrong
show 5 y_labels ,is normal . The other is wrong

@KevinZK
Copy link
Author

KevinZK commented Apr 21, 2017

in the YAxisRenderer.swift file, when show the view for the first time, the positions[i].y 's value is inaccurate in function drawYLabels. then,when i touch view or zoom the view,the positions[i].y 's value will be right. I don't know how the internal implementation,I can't find the method to solve this problem

@liuxuan30
Copy link
Member

I can't tell what's wrong, but you can check some places:

        if _autoScaleMinMaxEnabled
        {
            autoScale()
        }

autoScaleMinMaxEnabled just call autoScale(), no other things when I search in the library.
You can start debug here.

For y axis labels, take a look at computeAxisValues() to check how axis.entries is generated, when the label count is wrong.

@liuxuan30
Copy link
Member

BTW, are you able to reproduce it with ChartsDemo?
Basically, you enabled many features, while I am not sure if they are conflict.

@KevinZK
Copy link
Author

KevinZK commented May 15, 2017


wechatimg19

@liuxuan30 i fixed YAxis labels position and cooperate with LimitLine。values is not corresponding,

@thirdson
Copy link

hi @liuxuan30 seam like after adjust the viewport -- either scale or realtime feed in , although the Y axis's max and min value recalculated, but the Y axis not refresh or redraw, if you manually scale the view the Y axis will adjust correctly.

@thirdson
Copy link

@KevinZK possible you should parse all the configuration flag initialized or changed between here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants