x-axis ticks, major/minor grid lines

1,164 views
Skip to first unread message

diomedes

unread,
Jan 4, 2008, 12:32:30 PM1/4/08
to Google Chart API
Hi all,

First congratulations for the awesome library.

I need to control the x-axis ticks for line charts and it seems that
they just don't want to be there :-)
Ticks always appear on the y-axis next to the labels and on the x-axis
labels for bar charts scatter plots (and maybe others) but not for
line charts.
Am I missing something?

Ideally the ticks should be controlled independently (for example
excel has major/minor grid line drawn as grid or just a tick
independently of labels).

As for me, I am trying to create charts similar to those in alexa
( e.g. http://traffic.alexa.com/graph?c=1&f=555555&u=google.com&r=3m&y=r&z=3&h=300&w=610
)
so I am using the labels/grid lines for the months and I need the
minor ticks for the weeks. (I am using the gchartrb ruby wrapper)
My best guess to achieve that is to use a white-colored horizontal
data line a few pixels above the x-axis with points for each week and
put V markers along all its points to draw the ticks
The disadvantage of this approach is that it draws the marker above
the axis instead of below plus changing the size of the chart affects
the placement of the line - so I need to take that into account and
that makes things uglier etc etc

Any suggestions would be greatly appreciated

diomedes

Uwe Maurer

unread,
Jan 7, 2008, 4:15:48 AM1/7/08
to Google Chart API
Hi diomedes,

On Jan 4, 6:32 pm, diomedes <alakaz...@gmail.com> wrote:
> I need to control the x-axis ticks for line charts and it seems that
> they just don't want to be there :-)
> Ticks always appear on the y-axis next to the labels and on the x-axis
> labels for bar charts scatter plots (and maybe others) but not for
> line charts.
> Am I missing something?

Currently the ticks are only placed next to a label. The only way to
have additional ticks would be to specify an empty label, which is not
so great. We will think about how to make the ticks more flexible.

> Ideally the ticks should be controlled independently (for example
> excel has major/minor grid line drawn as grid or just a tick
> independently of labels).

I agree.

> As for me, I am trying to create charts similar to those in alexa
> ( e.g.http://traffic.alexa.com/graph?c=1&f=555555&u=google.com&r=3m&y=r&z=3...
> )
> so I am using the labels/grid lines for the months and I need the
> minor ticks for the weeks. (I am using the gchartrb ruby wrapper)
> My best guess to achieve that is to use a white-colored horizontal
> data line a few pixels above the x-axis with points for each week and
> put V markers along all its points to draw the ticks
> The disadvantage of this approach is that it draws the marker above
> the axis instead of below plus changing the size of the chart affects
> the placement of the line - so I need to take that into account and
> that makes things uglier etc etc

Using the markers is a good trick! However I think it is better to
specify empty labels for now. (the ticks will be at the outside of the
chart area then)

Thanks,
Uwe

Boris

unread,
Jan 27, 2008, 5:44:08 PM1/27/08
to Google Chart API
Hello,

I do have the same issue as diomedes: No ticks at the x-axis of my
line chart at all. Is there some way to configure the appearance of
such ticks?

Cheers,
boris

On Jan 7, 10:15 am, Uwe Maurer <uwe.mau...@google.com> wrote:
> Hi diomedes,
>
> On Jan 4, 6:32 pm, diomedes <alakaz...@gmail.com> wrote:
>
> > I need to control the x-axisticksfor line charts and it seems that
> > they just don't want to be there :-)
> >Ticksalways appear on the y-axis next to the labels and on the x-axis
> > labels for bar charts scatter plots (and maybe others) but not for
> > line charts.
> > Am I missing something?
>
> Currently theticksare only placed next to a label. The only way to
> have additionaltickswould be to specify an empty label, which is not
> so great. We will think about how to make theticksmore flexible.
>
> > Ideally theticksshould be controlled independently (for example
> > excel has major/minor grid line drawn as grid or just a tick
> > independently of labels).
>
> I agree.
>
> > As for me, I am trying to create charts similar to those in alexa
> > ( e.g.http://traffic.alexa.com/graph?c=1&f=555555&u=google.com&r=3m&y=r&z=3...
> > )
> > so I am using the labels/grid lines for the months and I need the
> > minorticksfor the weeks. (I am using the gchartrb ruby wrapper)
> > My best guess to achieve that is to use a white-colored horizontal
> > data line a few pixels above the x-axis with points for each week and
> > put V markers along all its points to draw theticks
> > The disadvantage of this approach is that it draws the marker above
> > the axis instead of below plus changing the size of the chart affects
> > the placement of the line - so I need to take that into account and
> > that makes things uglier etc etc
>
> Using the markers is a good trick! However I think it is better to
> specify empty labels for now. (thetickswill be at the outside of the
Reply all
Reply to author
Forward
0 new messages