Labels on axis

284 views
Skip to first unread message

Jon Smith

unread,
May 5, 2014, 9:49:29 AM5/5/14
to flot-...@googlegroups.com
Hi,
I'm trying me hand with Flot and it looks good. However one noteable omission from every example - none a single one of them includes a label on their axis saying what the axis represents.

(they call it an x-axis title there.)


I've tried looking at the API documentation but couldn't see anything there (missed it probably).
So I tried:
options:{
xaxis:{
label:"Number of requests"
},
yaxis:{
label: "Month"
}
}

But that didn't work either.

So how do I labe/titlel my axis?

Thanks

Elaine Looney

unread,
May 5, 2014, 11:16:18 AM5/5/14
to flot-...@googlegroups.com
Hi Jon, 

I had to go with using this plugin: https://github.com/markrcote/flot-axislabels.

It sounded like axis labels were in the latest release but I wasn't able to find them.

Ced

unread,
May 5, 2014, 2:34:09 PM5/5/14
to flot-...@googlegroups.com
You can use the axislabels plugin, or create your own html elements to hold the labels outside of the graph div.

Jon Smith

unread,
May 5, 2014, 3:32:02 PM5/5/14
to flot-...@googlegroups.com
Thanks. I must admit I'm surprised that such a core component of a chart is a plugin, and not one that comes with the distribution either.
(I was trying to avoid using HTML elements.)

I'll give that a try. Much appreciated!

Mark Côté

unread,
May 6, 2014, 8:45:22 AM5/6/14
to flot-...@googlegroups.com
I believe they are still planned for version 0.9; the work was committed to the 0.9-work branch last year: https://github.com/flot/flot/pull/1090

Mark
--

---
You received this message because you are subscribed to the Google Groups "Flot graphs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flot-graphs...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jon Smith

unread,
May 6, 2014, 1:06:18 PM5/6/14
to flot-...@googlegroups.com, mc...@alumni.uwaterloo.ca
That's good to know. Is there an ETA on 0.9? The last update was http://www.flotcharts.org/blog/2013/09/29/flot-09-update/ - quite a while back.
Thanks.

Stephanie Jacobs

unread,
Apr 1, 2015, 10:20:50 PM4/1/15
to flot-...@googlegroups.com
Are you freaking kidding me? How are axis labels not part of the core???? Didn't everyone learn in school that EVERY graph should be well-labeled? Sheeeeeeesh!!

Glad you asked, John! Thanks!
Reply all
Reply to author
Forward
0 new messages