Flot: how to align xaxis labels center over the tick line, and put labels in the plot area instead of outside space

709 views
Skip to first unread message

Xudong

unread,
May 8, 2011, 12:38:39 AM5/8/11
to flot-...@googlegroups.com
Hi,

I am wondering whether there's configuration to put axis ticks "center" over the tick line? and also put them in the plot area instead of outside space?

for the latter issue, i used "labelMargin:-30" in the grid options, while it made a difference than not setting this, however, no further difference if i set "labelMargin:-50" or using another bigger negative number. anybody knows how to deal with this?

thanks in advance!

Ole Laursen

unread,
May 11, 2011, 5:48:36 AM5/11/11
to flot-...@googlegroups.com
2011/5/8 Xudong <liux...@gmail.com>:

Hi!

I'm afraid you can't really configure this.

If you really need this, I think you have two options: you can hack
the tick layout algorithm in Flot somehow (be warned that it's a bit
complicated piece of code, though; or you can disable the text labels
and add some yourself - there's an example of adding text in the
annotating example bundled with Flot.


Ole

Xudong

unread,
May 11, 2011, 5:52:29 AM5/11/11
to flot-...@googlegroups.com
thanks Ole. I will look into it!
Reply all
Reply to author
Forward
0 new messages