"Extreme" min/max setting
Actually, if I set min and max on y axis, the chart allways shows min and max values. My idea is to set an "extreme" min/max, and the autoscale continue to operate, but limited by theses "extreme" min/max values
Did a first implementation of two new axis options, floor and ceiling. Please give feedback. Demo: http://jsfiddle.net/highcharts/7N8he/
-
R. Schreurs commented
I am looking exactly for this. Very useful for displaying percentages floor 0% ceiling 100%, or fractions floor 0: ceiling 1.
Currently, even if my values do not extend beyond such limits, as that is physically impossible, sometimes HighCharts will still extend the axis. -
Jamie commented
@torstein - I think the 'upper/lower' is meant as the same thing being requested here: http://highcharts.uservoice.com/forums/55896-general/suggestions/1848953-extend-the-axis-max-property-to-act-like-css-mi
Floor and Ceiling are great features, demo works well. But I personally find the opposite more of a requirement: show from 0 to 100 at all times, but if the data goes beyond those points, expand to show them. -
Eric Jain commented
Perfect!
-
Eric Jain commented
Ran into this issue, too. Highcharts is pretty smart about labeling axes, in general, but having negative-valued labels for values that can't ever be negative does look odd.
-
@Torrance Scott: I don't think so - I would say floor and ceiling means that min and max should always stay within that range. I can't see a situation where we need a floor for the max value that is higher than the floor for the min value? Or is there?
-
Torrance Scott commented
Floor and Ceiling seems like a great implementation. You might want to set the upper and lower bounds for this as well. So you'd need four options like UpperCeiling, UpperFloor, LowerCeiling, LowerFloor. Does this make sense?
-
Mitch commented
Torstein, that implementation sounds perfect.
-
Malte Hansen commented
Is this still not possible?
-
Andruscha commented
There is another item which means IMHO the same: "Extreme" min/max setting(10 votes at this time)
-
Harmen commented
The maximum Y axis maximum is either set or calculated from the values. For esthetic values it is nice to set a 'minimum maximum'.
Example would be 'use 5 as the maximum, unless the values go over that, than use the real maximum'.
Hmm, how can we attach the patch here?
@@ -1297,6 +1297,8 @@
· lineWidth: 0,^M
· maxPadding: 0.05,^M
· minPadding: 0.05,^M
+· minmax: 0,^M
+· minmin: 0,^M
· startOnTick: true,^M
· tickWidth: 0,^M
· title: {^M
@@ -4252,7 +4254,9 @@
· · · userMin,^M
· · · userMax,^M
· · · max = null,^M
+· · · minmax = options.minmax,· // use at least this value for max^M
· · · min = null,^M
+· · · minmin = options.minmin,· // use at least this value for min^M
· · · oldMin,^M
· · · oldMax,^M
· · · minPadding = options.minPadding,^M
@@ -4943,6 +4946,17 @@
· · · · · · · · ignoreMaxPadding = true;^M
· · · · · · · }^M
· · · · · · }^M
+^M
+· · · · · · // optionally use a certain minimum for the YAxis^M
+· · · · · · if (!isXAxis) {^M
+· · · · · · · if (dataMax < minmax) {^M
+· · · · · · · · dataMax = minmax;^M
+· · · · · · · }^M
+· · · · · · · if (dataMin > minmin) {^M
+· · · · · · · · dataMin = minmin;^M
+· · · · · · · }^M
+· · · · · · }^M
+^M
· · · · · }^M
· · · · }^M
· · · });^M -
Jamie commented
On a related note: http://highcharts.uservoice.com/forums/55896-general/suggestions/1848953-extend-the-axis-max-property-to-act-like-css-mi
It seems these two functionalities should be combined