fixes#8446. Data with all values equal to zero, creates a max with the
value of Infinite. The for loop for creating ticks then gets stuck in an
infinite loop. This fix resets min and max and creates some fake ticks
for the y-axis if the min and max are not finite numbers.
This is an old PR so had some problems after merging in master.
- Fix for min and max that were not getting passed into the
applyLogScale function
- Fix for when min/max were undefined rather than null
- Fix for decimal ticks, as this PR populates the ticks itself then
it also needs to calculate the number of decimal places too. Flot
was showing the wrong number of decimal places sometimes otherwise
on the y-axis.
* fix(flexible_y-min/max): fixed negative values support and added tests for this.
* fix(flexible_y-min/max): fixed issue with Y-Min and Y-Max values stored as numbers.
Issue: panels with configured Y-Min and Y-Max don't display anything
after upgrade.
* Feature: Flexible Y-Min and Y-Max settings.
Y-Min and Y-Max is now string.
New usage for both Y-Min and Y-Max (Where X is a real number):
>X Y-Max/Y-Max is auto if data is above X else X
<X Y-Max/Y-Min is auto if data is below X else X
=X Y-Max/Y-Min is scaled to current value +/- X
~X Y-Max/Y-Min is caled to average value +/- X
Example: Y-Min: <100 Y-Max: >200
If all points are within 100 and 200: Y-Min is 100 and Y-Max is 200
If some points are above 200: Y-Min is 100 and Y-Max is auto
If some points are below 100: Y-Min is auto and Y-Max is 200
if some points are below 100 and above 200: Y-Min and Y-Max is auto
Tests for new settings added
* Use parseFloat instead of implicit conversion
* feat(flexible_y-min/max): refactor.
* feat(flexible_y-min/max): added more tests.
fixes#3852. The function that calculates the date format for
the x-axis on a panel takes the panel width into account and
can be wrong for certain date ranges if the panel is too
narrow. E.g. can show dates in format %m/%d %H:%M when it
should show it as %H:%M