Can you invert values of axes ?

3 views
Skip to first unread message

Brice Z

unread,
Aug 12, 2009, 3:54:15 AM8/12/09
to Flotr Javascript Plotting Library
Hello,

I have a little question about Flotr. Is it possible to invert datas
on an axes ?
For example to begin in my y axes with the value 1 on max and min with
5 or more ...

I'm sorry if i did errors in my question but i'm french and my english
is not very good :-S

I hope that the answer to my question is not in your documentation. If
is it, my apologies but i didn't found it !

Thank you

Fabien Ménager

unread,
Aug 16, 2009, 7:14:53 AM8/16/09
to Flotr Javascript Plotting Library
Hello, I'm French too, so you can contact me personally if you want
to.
Actually, you can't invert the axes with a simple option, but you can
invert your data like this :

[[0, 3], [1, 2], [2, 7], [3, 1], [4, 8], [5, 4]]

to become

[[0, 4], [1, 8], [2, 1], [3, 7], [4, 2], [5, 3]]

And set the ticks like this :

yaxis.ticks = [[0, "5"], [1, "4"], [2, "3"], [3, "2"], [4, "1"], [5,
"0"]]

But the track formatter will take the transformed data in the track
info, so you'll need to translate this data into real data in the
trackFormatter function.

Hope this helps !

The invert feature could be useful, I'll add it to the TODO list.

Fabien
Reply all
Reply to author
Forward
0 new messages