anirudhb029 / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

Custom tick sequence #144

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Probably there is already a way, but I really want something different.
I want the x axis tick to go according to the index of the tick array.
e.g. tickarray = [4,5,6,7,1,2,3]

then the axis should have tick like that.
Is it possible?

Original issue reported on code.google.com by pen...@gmail.com on 26 Mar 2009 at 5:16

GoogleCodeExporter commented 9 years ago
I didn't mean to add it as a defect, I couldn't change the type...

Original comment by pen...@gmail.com on 26 Mar 2009 at 5:16

GoogleCodeExporter commented 9 years ago
No, because what you're saying here means add ticks at value 4, 5, etc. How 
would
Flot know that 4 signifies 1 (or 0) as opposed to the value 4, e.g. I could have
specified [0, 4, 8, 12]?

What you can do, is [[1, "4"], [2, "5"], ...] which means add a tick a value 1 
with
the label 4.

I can't see how Flot can do anything else than what it is doing now without 
adding an
option which I don't think this warrants.

Original comment by olau%iol...@gtempaccount.com on 31 Mar 2009 at 7:34

GoogleCodeExporter commented 9 years ago
I didn't know that, nowhere in the documentation mention that you can add 
labels on
the axis ticks. If I knew that I wouldn't ask this question. Unless I missed it.
Could you point it out where it is in the API.txt? Or somewhere else?

Original comment by pen...@gmail.com on 31 Mar 2009 at 11:12

GoogleCodeExporter commented 9 years ago
oh, I see it. But it's ambiguous. It only says you can do this:   ticks: [[0,
"zero"], [1.2, "one mark"], [2.4, "two marks"]] How would I know that strings 
are
labels unless I tried it? Maybe a update on the documentation? That would be 
helpful,
thanks.

Original comment by pen...@gmail.com on 31 Mar 2009 at 11:14

GoogleCodeExporter commented 9 years ago
No offense intended. :) You're right about it being implicit, I've now 
reformulated
it to be more explicit. Thanks for the suggestion!

Original comment by olau%iol...@gtempaccount.com on 1 Apr 2009 at 3:23