No minimum value displayed on inverted y axis

38 views
Skip to first unread message

Paul Brogan

unread,
Apr 9, 2015, 10:34:18 AM4/9/15
to flot-...@googlegroups.com
I'm using the default transform function to make the y axis go top to bottom (low to high):
yaxis: {
    min
: 1,
    minTickSize
: 1,
    tickDecimals
: 0,
    transform
: function(x) { return -x; },
    inverseTransform
: function(x) { return -x; },
    tickFormatter
: function(x) { return new String(x); }
}


However, I can't seem to get the minimu value of 1 to show, on any chart.

For example:
http://cliptheapex.com/fantasy-f1/seasons/2014/
http://cliptheapex.com/fantasy-f1/players/mike.162/

I've checked the API and searched around for a solution but can't seem to find anything.

Has anyone managed this or know how to resolve it?

Thanks.

Ced

unread,
Apr 9, 2015, 1:33:19 PM4/9/15
to flot-...@googlegroups.com
The inversion of the y-axis is irrelevant here.
The default tick generator is trying to give you a reasonable number of ticks while evenly spacing them out.  It's actually trying to put a zero as the first tick, but since you set the minimum to one, the first tick isn't shown.

You can get around this by creating your own tick generator.  Here's a sample tick generator based on the default one that will replace zero with one as the first tick.

http://jsfiddle.net/Lkkxgexj/

Brogan

unread,
Apr 9, 2015, 8:05:32 PM4/9/15
to flot-...@googlegroups.com
Many thanks.

I'll give that a go.
Reply all
Reply to author
Forward
0 new messages