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

LineChart Y-Axis doesn't scale #9

Closed
ryanbillingsley opened this issue Mar 23, 2015 · 3 comments
Closed

LineChart Y-Axis doesn't scale #9

ryanbillingsley opened this issue Mar 23, 2015 · 3 comments
Labels

Comments

@ryanbillingsley
Copy link

The scale will start at 0 no matter what. If you have values, in say, the 40-60 range, they will get smashed into a tiny part of the range which will be from 0-60.

@gizak
Copy link
Owner

gizak commented Mar 23, 2015

Hi @ryanbillingsley, this is due to LineChart' range keeps enlarging but not shrinking back when the given data is in smaller interval. So I guess in your case, you may have fed a small number (0 maybe) and the display range is stuck there.

This is actually a bug need to fix, and will fix soon. Let me know if this is not your case.

@ryanbillingsley
Copy link
Author

@gizak that data starts with the 40 - 60 interval, so the range isn't changing. It looks like the problem lies with this line in chart.go:

if lc.minY < lc.bottomValue {
    lc.bottomValue = lc.minY - 0.2*span
}

Because lc.bottomValue is not being set to anything, it will be 0, and always 0.

@gizak
Copy link
Owner

gizak commented Mar 23, 2015

@ryanbillingsley, Hey you are right, it's not been initialized! Will fix it!

@gizak gizak added the bug label Mar 24, 2015
@gizak gizak closed this as completed in 6a92b44 Apr 10, 2015
kamisdev pushed a commit to kamisdev/powerfulTERMINAL that referenced this issue May 7, 2022
sadevn added a commit to sadevn/go-terminal that referenced this issue Mar 4, 2023
newheaven918 added a commit to newheaven918/termdashboard that referenced this issue May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants