No minimum value displayed on inverted y axis

38 visualizações
Pular para a primeira mensagem não lida

Paul Brogan

não lida,
9 de abr. de 2015, 10:34:1809/04/2015
para 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

não lida,
9 de abr. de 2015, 13:33:1909/04/2015
para 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

não lida,
9 de abr. de 2015, 20:05:3209/04/2015
para flot-...@googlegroups.com
Many thanks.

I'll give that a go.
Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem