gillius / jfxutils

JavaFX Utilities - Zoom and Pan Charts and Pane Scaling
Apache License 2.0
68 stars 22 forks source link

StableTickAxis fix : detect if difference between min&max is smaller tha... #1

Closed dweil closed 10 years ago

dweil commented 10 years ago

...n e-300 instead of equality

gillius commented 10 years ago

Thanks for the pull request. Can you explain what issue this causes and when? Is the concern that when the range is too small the padding logic breaks down? If that's the case, then is the "default padding" of 1 unit on either side appropriate for this, or should it be smaller? It seems if the range is extremely small (within a few orders of magnitude from epsilon as you have selected), what will happen is you'll get visually a flat line of data. I suppose that makes sense.

dweil commented 10 years ago

Yes, a flat line of data on the bottom of the chart and not in the middle. It is not visible for the user. Note that the choice of epsilon (e-300) is arbitrary. It works for my examples. Here are the screenshots I get before and after the patch with a single serie of 0.0 (or almost) : before : image after : image

gillius commented 10 years ago

Awesome, thanks for the patch and explaining it.