Line chart for Datetime objects on x axis and without comparison of the multiple columns

48 views
Skip to first unread message

Raj Patel

unread,
Jul 17, 2016, 11:37:15 AM7/17/16
to Google Visualization API
Hello all,

I want to create a single line graph for multiple columns (lines) whose x axis should be datetime object and the y axis is some integer number for every column.

Example:
So say I have two lines (can be more) - Line 1, Line 2
And the data being --> 
Line 1 -> [['2014-01-13 00:05:51', 50], ['2014-05-15 13:12:10', 100], ['2015-01-04 04:11:50', 10], ['2015-05-11 23:11:10', 180]] 
Line 2 -> [['2014-02-11 02:56:33', 10], ['2015-01-15 02:50:18', 80], ['2016-01-24 11:12:10', 100]]

So as you may have figured out there may not be common x values for both the lines. But the example on the Line Chart page requires value corresponding to each column.

Is there any such chart option that I am missing?
Any help would be appreciated.
Thanks.

Daniel LaLiberte

unread,
Jul 18, 2016, 8:56:37 AM7/18/16
to Google Visualization API
First, use actual Dates, either with the JS Date constructor, or with the string notation "Date(yyyy, mm, dd)"

In order to mix two or more series where not all series have the same domain values, you should just use null values where there is no series value, and then set the option interpolateNulls to true.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/4d51f2d4-d761-4dd4-a974-a723c48664a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Raj Patel

unread,
Jul 18, 2016, 1:48:27 PM7/18/16
to Google Visualization API
Thanks a lot Daniel!

Raj Patel

unread,
Jul 25, 2016, 3:25:05 AM7/25/16
to Google Visualization API
Hey Daniel,

It seems interpolateNulls option does not work with material charts.
Please help.

-- Raj

On Monday, 18 July 2016 23:18:27 UTC+5:30, Raj Patel wrote:
Thanks a lot Daniel!
Reply all
Reply to author
Forward
0 new messages