Date as an x-axis - correct scaling

36 views
Skip to first unread message

Sam Halliday

unread,
Dec 11, 2011, 12:36:17 PM12/11/11
to Google Visualization API
Dear all,

When I plot my charts (Line, Area, Combo, etc) with Date objects as
the x-axis, the values of the x-axis are automatically calculated and
a sensible tick size is selected. However, if the x values are not
evenly spaced apart, (e.g. missing values) then the x-axis does not
reflect a linear progression of time.

As a hack, I'm going to create empty data values but is there an
option to let the Google API pick up on this and scale the x axis
correctly?

Regards, Sam

Roni Biran

unread,
Dec 12, 2011, 3:08:13 AM12/12/11
to google-visua...@googlegroups.com
Hi Sam,

At the moment, only lineChart have an interpolation option for null values.
If I were you, I would interpolate myself all the data in advance, since you're using the data in various charts.
If you intend to use only lineChart, add the "interpolateNulls: true" to your drawing options.







--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
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.


asgallant

unread,
Dec 12, 2011, 8:34:49 AM12/12/11
to google-visua...@googlegroups.com
Is it the axis that is missing data points or the lines that are missing data points?  If it is the axis, you can set the strictFirstColumnType option to true, which will plot your dates on a time line.  If it is the lines, you need to set the interpolateNulls option to true (currently available only in Line Charts and for lines in Combo Charts - does not work for any other charts that I know of).
Reply all
Reply to author
Forward
0 new messages