Re: Simple Line Chart

28 views
Skip to first unread message

asgallant

unread,
Aug 20, 2012, 11:43:00 AM8/20/12
to google-visua...@googlegroups.com
Populate the data table the exact same way you would when using two series that do share x-axis values, but put use null for the series that doesn't have a value at each point:

var data new google.visualization.DataTable();
data.addColumn('number''X');
data.addColumn('number''Y1');
data.addColumn('number''Y2');
data.addRows([
    [11null],
    [1.5null2],
    [22null],
    [2.7null5],
    [332],
    [44null]
]);

On Saturday, August 18, 2012 1:21:02 PM UTC-4, sproketman wrote:
I am having a difficult time trying to find an example of plotting *two* time series with different x-axis values on *one* line chart. I have one series of (x,y) points:

(1,1), (2,2), (3,3), (4,4)

And a second series of (x,y) points:

(1.5,2), (2.7,5), (3,2.0)

How can I plot these two time series on one chart? Every example of plotting two series on a line chart has common values on the x-axis. Any help would be greatly appreciated.


Reply all
Reply to author
Forward
0 new messages