Area chart labels

28 views
Skip to first unread message

billsaysthis

unread,
Mar 5, 2012, 6:31:19 PM3/5/12
to google-visua...@googlegroups.com
We have a fairly simple use case, showing 2-90 days of a single data item, on an area chart. But I can't understand how to correct two issues with the horizontal axis labels, which are dates and have slanted=false, and would appreciate advice:

- some labels are cut off even though all are the same length (01/05/12, 12/32/11, etc)
- the first label is (seems to be) centered under the first data point, meaning that the left end of the label is actually underneath the vertical axis labels

Related, there are about 90 days data in the view on my screen at the moment but only two labels. If neither of the two issues was present this might not be so bad but as it is I would rather not have the first item get a label. Reading through previous messages in this group I see that it isn't possible to control the number of labels in a continuous data series but the advice I see for making it treated like a discrete series is to have the first item have a string data type. Unfortunately if I change my first addColumn call to pass string instead of number I don't get a chart.

Thanks,
Bill

Viz Kid

unread,
Mar 6, 2012, 8:24:18 AM3/6/12
to google-visua...@googlegroups.com

Seeing a live example would be helpful to understand the problem.
If your x-axis values are dates, the type of the column should be date, but also the values that you assign to it while populating the data should be of type date and not strings.

  Viz Kid

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/nQl8uyzU8REJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

billsaysthis

unread,
Mar 6, 2012, 11:33:08 AM3/6/12
to google-visua...@googlegroups.com
A live sample would be difficult. However I can clarify one point: the data are numbers (e.g., page view count for a given day) and the labels are the date of that count.

Thanks,
Bill

Viz Kid

unread,
Mar 7, 2012, 12:30:50 PM3/7/12
to google-visua...@googlegroups.com

Unfortunately I cannot help you without seeing the chart (even a screenshot would clarify it a bit, but better to have a live chart).
You don't need to give us a link to your live application - just add a breakpoint when you call to the draw method and extract the data and options you are using. You can then plug them into a chart in the playrgound and send it to us (http://code.google.com/apis/ajax/playground/#area_chart)

Best,
  Viz Kid

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
Reply all
Reply to author
Forward
0 new messages