Depending on how you want your chart to look, it might be better to merge 
your data like this:

X  | Y1   | Y2   |
---|------|------|
1  | 400  | null |
2  | 500  | null |
3  | 700  | null |
10 | null | 100  |
20 | null | 800  |
30 | null | 788  |

On Monday, August 12, 2013 8:23:09 AM UTC-4, Daniel LaLiberte wrote:
>
> Hi Gaurab,
>
> You can represent datatables that have multiple pairs of domain and series 
> columns, and some chart types will work with data in that form.  See the 
> section about "domain" roles on 
> https://developers.google.com/chart/interactive/docs/roles where an 
> example is included.
>
> Here is an example of code that uses two domains:
>
> function drawVisualization() {
>   // Create and populate the data table.
>   var data = new google.visualization.DataTable();
>   data.addColumn({label: '2009 Quarter', type: 'string' });
>   data.addColumn({label: '2009 Sales',  type: 'number' });
>   data.addColumn({label: '2009 Expenses',  type: 'number' });
>   data.addColumn({label: '2008 Quarter', role: 'domain', type: 'string' })
> ;
>   data.addColumn({label:  '2008 Expenses',   type: 'number' }); 
>   data.addColumn({label: '2008 Sales', type: 'number' });
>   data.addRows([
>   [   'Q1/09',   1000,        400,  'Q1/08',    800,      300 ],
>   [   'Q2/09',   1170,        460,  'Q2/08',    750,      400 ],
>   [   'Q3/09',    660,       1120,  'Q3/08',    700,      540 ],
>   [   'Q4/09',   1030,        540,  'Q4/08',    820,      620 ]
>   ]);
>
>   // Create and draw the visualization.
>   new google.visualization.LineChart(document.getElementById(
> 'visualization')).
>       draw(data, 
>            {
>              width: 500, height: 400
>            });
> }
>
> Note that you have to construct the table using the DataTable constructor 
> and add columns with the addColumn() method.  Hope that helps.
>
> dan
>
>
>
> On Mon, Aug 12, 2013 at 2:30 AM, gaurab saha <[email protected]<javascript:>
> > wrote:
>
>> Hello,
>>
>> I am not able to figure out how to display multiple data series where x 
>> and y axis are different. For example:
>> I have two data set X1Y1 and X2Y2 where value is 
>> X1Y1: 
>> {
>>  1:400,
>>   2:500,
>>   3:700
>> }
>> X2Y2:
>> {
>> 10:100,
>> 20:800,
>> 30:788
>> }
>>
>> Is this possible through google chart?
>>
>> -- 
>> 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 [email protected]<javascript:>
>> .
>> To post to this group, send email to 
>> [email protected]<javascript:>
>> .
>> Visit this group at 
>> http://groups.google.com/group/google-visualization-api.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> 
>  - 978-394-1058
> [email protected] <javascript:>   562D 5CC, Cambridge MA
> [email protected] <javascript:> 9 Juniper Ridge Road, Acton MA
>  

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to