HanSolo / charts

A JavaFX library that contains different kind of charts
Apache License 2.0
659 stars 81 forks source link

Updating Axis range in LineChart #91

Closed permiakover closed 2 years ago

permiakover commented 2 years ago

via setting minValue or/and maxValue at axis, axis stays at the same range. but if drag the application window - it will be updated and apply new values

permiakover commented 2 years ago

i think the calling on redraw() of Axis will fix this, but it is private

UPD: Axis -> redraw()& XYChart -> adjustChartRange() via reflection - and it works

HanSolo commented 2 years ago

Fixed issue with commit 4882f06445fd017b830c349baf354c0a7a5930ed It's in the jdk17 branch of the project and you might want to check it out to avoid reflection

permiakover commented 2 years ago

hi again! the problem is little bit more complex here - there is initial state of chart and Y-range is -50..50 изображение then switch to -10..10 изображение and finally to -150..150 изображение

as you see we need to adjustChartRange() and adjust grid

HanSolo commented 2 years ago

Maybe it's a good idea to provide a simple example that shows the problem, otherwise it just takes longer trying to reproduce your exact issue.

permiakover commented 2 years ago

sure i will prepair a simple project. on my way!

HanSolo commented 2 years ago

I think it's already fixed with commit: 92a284e9f29a410c3ca1a741f7e4e68e385c5468 Can you give it a try please ?

permiakover commented 2 years ago

I'm not sure how to try the commit, because all project git clone fails with gradle issues - kinda like 'ossrhUsername' for Credentials [username: null]" but from code this is exactly the thing

HanSolo commented 2 years ago

Oh...that's unfortunate, well I've tested it using the GridTest class in the test package and it does what you expected.

HanSolo commented 2 years ago

Will quickly release another version...

HanSolo commented 2 years ago

Released 17.1.25 to Maven central but might take a bit before it will show up...

permiakover commented 2 years ago

yes, it is brilliant!

HanSolo commented 2 years ago

Glad it works as expected 👍🏻