AAVSO / VStar

VStar is a visualisation and analysis tool for variable star data brought to you by AAVSO
https://www.aavso.org/vstar
GNU Affero General Public License v3.0
10 stars 3 forks source link

Time axis tick labels switch to scientific notation with enough zoom #293

Closed dbenn closed 1 year ago

dbenn commented 2 years ago

See https://www.aavso.org/comment/162855#comment-162855 from @BradWalter

mpyat2 commented 1 year ago

Technically, it is possible to set a user-defined formatter for the axis, i.e. in the AbstractObservationPlotPane constructor:

        NumberAxis domainAxis = (NumberAxis) chart.getXYPlot().getDomainAxis();
        domainAxis.setNumberFormatOverride(myFormatter);

This will prevent an automatic switch to scientific notation.

However, the number of decimal digits will change depending on zoom even if a user-defined formatter is set.

From my point of view, the current behavior is acceptable; in my tests, the switch occurs when Tmax - T min < 0.001 (approximately).

dbenn commented 1 year ago

Thanks for your analysis and suggested fix @mpyat2. I tend to agree with your conclusion.

The alternatives seem to be:

I suspect you would recommend the second option? At the very least, this is a low priority.

mpyat2 commented 1 year ago

Hi @dbenn , I think the second option is better. The 'fix' I proposed is rather a concept; the axis with a user-defined format I've tried looked more 'ugly' than the original. It seems we must implement too many tiny things to make the fix appropriate.