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

About Auto-scaling on axis #259

Closed
kscorpio opened this issue Jul 31, 2015 · 15 comments
Closed

About Auto-scaling on axis #259

kscorpio opened this issue Jul 31, 2015 · 15 comments

Comments

@kscorpio
Copy link

1 about y
i use the newest release 2.1.2
i find Auto-scaling y axis' min/max
but when set autoScaleMinMaxEnabled=YES, the y scaleling range is decided by the points which can be seen in the screen, not by the dataset y values,
so when i move a point out of the screen , the y axis will change suddenly;

2 about x

x cant move to the value which is out of the dataset.xvalue, the first and last point is limits

how can the chart move freely&infinitely in x y direction ??

@liuxuan30
Copy link
Member

for Q1, I am not sure what's your problem. the yaxis changes if needed.. I suppose

for Q2, I guess you can't... once it reaches the min/max index on x axis, it will stop scrolling. But you could try insert many xIndex and don't insert dataEntry for these xIndex... But it's too hacky and I won't try it for performance issue :-) Also I don't think it makes sense to scroll infinitely

Chart is to provide better readabilty about data, not a playground.

@kscorpio
Copy link
Author

kscorpio commented Aug 3, 2015

Q1: e.g. y:{ 0,1,2,3,4,5,6,7} ,y is from 0 to 7, reset the scale to make point { 0,1,2,3} can be seen in the screen , now the yaxis disctance is from 0-3,

but when move the line in xaxis , the yaxis disctance will jump to 0-7, this looks bad in visual .

how to fix this , (notice: the y value is random, so maybe could not set custom x and y value)

@liuxuan30
Copy link
Member

I remember when you zoomed in and scroll, the yaxis will calculate its range as needed, so if currently is {0,1,2,3} on screen, when you start to scroll to 4-6, it will calculate the new range, like [0,6]. I don't see it's bad in visual, because you have new points and larger values, if the yAxis keeps in [0,3], and there is a point y:6, if you draw this point on [0,3], it is wrong.

@kscorpio
Copy link
Author

kscorpio commented Aug 3, 2015

Maybe you coulg have a try like {0,0,0,0,0,0,0,0,0,0,0,-90,120,-90,120,-90,120,-90,120,-90,......,,0,0,0,}

when scroll between -90 and 120, the yaxis is calulate,and the the scale in y has chaged,

in visual, the line is zooming in y direction or flicker

so move in x direction lead to yaxis zoom

@AlBirdie
Copy link
Contributor

I don't really understand your problem here. Could you maybe make a video of your issue in order to illustrate it better?

Anyway, I just found a bug with the autoscaling myself. It occasionally happens, that the x axis is being moved when autoscaling is enabled, which shouldn't be the case. I have yet to find the origin of that issue, but this could be a tricky one...

@kscorpio
Copy link
Author

http://pan.baidu.com/s/1c0jm788
http://pan.baidu.com/s/1c00N1KW

i‘m not sure if you can open the video successfuly

@AlBirdie
Copy link
Contributor

Nope, doesn't load without some sort of login, I suppose.

@kscorpio
Copy link
Author

can not download?

@danielgindi
Copy link
Collaborator

The chart can not move "infinitely in any direction", as it is not video game, its a view that is supposed to view a chart. So you can scale and drag to the edges of the chart.

About "auto-scaling" feature:
It is meant for the exact behaviour you are seeing. It scales the yAxis to the points currently visible (on the visible on the xAxis range).
If you want the min/max visible yAxis range to be according to the whole dataset - just disable the auto-scaling feature. Which is disabled by default.

@kscorpio
Copy link
Author

if disable the auto-scaling ,how to set the y min/max dynamicly , when add new point to the line and the new value maybe bigger than the point existed?

@danielgindi
Copy link
Collaborator

I think you should just reset the scaleY of the viewportHandler to 1.0

@kscorpio
Copy link
Author

setScaleMinima:0 scaleY:1.0 ??

or which method?


when add a new point to line , i change the customMaxValue and minvalue ,but it does`t work

@WushuputiGH
Copy link

Hi, kscorpio 你是否解决了关于自动调节高度, 出现突然跳动的问题

@pmairoldi
Copy link
Collaborator

Please keep the conversation in English if possible. It is more accessible for most people. Thanks.

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

No branches or pull requests

6 participants