Staggering x-axis labels on bar chart

1,320 views
Skip to first unread message

tcx

unread,
Aug 18, 2011, 5:14:17 PM8/18/11
to jqplot-users
I have a rather long bar chart and the labels along the x-axis tend to
overlap. Is there a way to stagger the labels to avoid overlap?

This site (http://peltiertech.com/Excel/Charts/Staggered.html) gave me
the idea of prepending a br-tag to every other item, but spacing isn't
quite right. I might be able to hack it to work, but before going down
that road, I figured I should ask to see if there was a built-in way
to do this?

tcx

unread,
Aug 19, 2011, 1:21:29 PM8/19/11
to jqplot...@googlegroups.com
Played around with this a little, as seen in the attachment.May still hit issues if the names are much longer...we'll see.
samplelongnames.png

Chris Leonello

unread,
Aug 20, 2011, 7:42:46 AM8/20/11
to jqplot...@googlegroups.com
Another possible work around is to use the canvasTextRenderer and canvasAxisTickRenderer and use rotated tick labels.  You can see an example here:  http://www.jqplot.com/tests/rotated-tick-labels.php

-- 
Chris Leonello
http://www.jqplot.com
--
You received this message because you are subscribed to the Google Groups "jqplot-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jqplot-users/-/2eWcfO7sKFoJ.
To post to this group, send email to jqplot...@googlegroups.com.
To unsubscribe from this group, send email to jqplot-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jqplot-users?hl=en.

Attachments:
- samplelongnames.png

tcx

unread,
Aug 20, 2011, 10:34:23 AM8/20/11
to jqplot-users
*That's* what I was looking for initially - thanks! Hah, now I have to
decided which I like better... By the way, the stagger I ended up
doing was fairly simple. I think it might make a good feature to add
and offer.

On Aug 20, 4:42 am, Chris Leonello <jqplot-us...@jqplot.com> wrote:
> Another possible work around is to use the canvasTextRenderer and canvasAxisTickRenderer and use rotated tick labels. You can see an example here:http://www.jqplot.com/tests/rotated-tick-labels.php
>
> --
> Chris Leonellohttp://www.jqplot.com
>
>
>
>
>
>
>
> On Friday, August 19, 2011 at 1:21 PM, tcx wrote:
> > Played around with this a little, as seen in the attachment.May still hit issues if the names are much longer...we'll see.
>
> > On Thursday, August 18, 2011 2:14:17 PM UTC-7, tcx wrote:
> > > I have a rather long bar chart and the labels along the x-axis tend to
> > > overlap. Is there a way to stagger the labels to avoid overlap?
>
> > > This site (http://peltiertech.com/Excel/Charts/Staggered.html) gave me
> > > the idea of prepending a br-tag to every other item, but spacing isn't
> > > quite right. I might be able to hack it to work, but before going down
> > > that road, I figured I should ask to see if there was a built-in way
> > > to do this?
>
> >  --
> >  You received this message because you are subscribed to the Google Groups "jqplot-users" group.
> >  To view this discussion on the web visithttps://groups.google.com/d/msg/jqplot-users/-/2eWcfO7sKFoJ.
> >  To post to this group, send email to jqplot...@googlegroups.com (mailto:jqplot...@googlegroups.com).
> >  To unsubscribe from this group, send email to jqplot-users...@googlegroups.com (mailto:jqplot-users...@googlegroups.com).
Reply all
Reply to author
Forward
0 new messages