You have to have both series of data in a single DataTable. Your data set
would look like this:
x y1 y2
1 3 null
2 5 3
3 null 5
4 6 null
5 null 4
6 null 7
7 8 null
Use a DataTable with that set to draw the chart. In the chart options, set
the "interpolateNulls" option to true, which prevents your lines from
having holes in them where the nulls are.
On Wednesday, December 5, 2012 9:15:40 AM UTC-5, Neri Martinez wrote:
>
> Hi,
> i have to draw a linechart with one, two o a lot of dataset.
> example:
> dataset1
> x y
> 1 3
> 2 5
> 4 6
> 7 8
>
> dataset2
>
> x y
> 2 3
> 3 5
> 5 4
> 6 7
>
> The problem here is that "x" axis data is not the same for both dataset.
> How can i add these two dataset to a line chart ?
>
> for one dataset i do (in grails):
>
> data = google.visualization.arrayToDataTable(${chartData});
> chart = new
> google.visualization.LineChart(document.getElementById('second_chart_div'));
> chart.draw(data);
>
> but i can't add another dataset (datatable)
>
> how can i do that?
>
> thanks!
>
>
--
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/-/hFVtI7XuFVoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.