Variable x-axis values

52 views
Skip to first unread message

Martin

unread,
Oct 5, 2011, 6:38:16 AM10/5/11
to Google Visualization API
Hello,

I love the google charts, but now i have a problem.

I would like to make a simple line or area chart, but my x-axis values
are not linear.
I have measurement values which come in at random intervals.

For example i have these values:
X Y
12:00 100
12:10 100
12:13 105
12:14 110
12:20 111
12:21 101

ofcourse the X values can also be numeric (timestamps)
But if i enter these values in a chart, the X distance between 12:00
and 12:10 is the same as between 12:13 and 12:14. This is ofcourse not
correct.

Is there a way to solve this problem?

asgallant

unread,
Oct 5, 2011, 10:43:02 AM10/5/11
to google-visua...@googlegroups.com
The line charts don't support variable spacing between data points, but scatter charts do.  You could also use the annotated time line charts, though they rely on Flash rather than SVG.

Jinji

unread,
Oct 5, 2011, 2:38:27 PM10/5/11
to google-visua...@googlegroups.com
I'm happy to say that since the last release, line chart and area chart also support this. You'll have to set strictFirstColumnType: true in the options. This is still not documented (we have a lot of documentation backlog to go over). Currently the default value of strictFirstColumnType is false, but in a few months it'll change to true, and later on it'll be completely removed so 'true' is the only option. X axis variable spacing will be triggered whenever you have a first column of type other than 'string'.

On Wed, Oct 5, 2011 at 4:43 PM, asgallant <drew_g...@abtassoc.com> wrote:
The line charts don't support variable spacing between data points, but scatter charts do.  You could also use the annotated time line charts, though they rely on Flash rather than SVG.

--
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/-/ZUTo_Yudk4cJ.

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,
Oct 5, 2011, 2:48:05 PM10/5/11
to google-visua...@googlegroups.com
Cool.  Might I suggest that this be an option, though, rather than the default?  Something like hAxis.spacing = 'fixed' / 'variable' will head off the inevitable "why is my axis spacing all weird?" questions.
Reply all
Reply to author
Forward
0 new messages