Hi, 

Is it possible to use the same data to produce different graphs/charts? 

I'm trying to covert this jsfiddle: http://jsfiddle.net/ovxLjqyn/
into two charts. 

The above jsfiddle demonstrates that every data column having a tooltip of 
its own from the corresponding tooltip data column. I want to move a step 
further, so that on char1 the T1/T2 to be tooltips for V1/V2; whereas on 
chart2, V1/V2 to be tooltips for T1/T2. 

That should be possible, but I'm wondering what I've done wrong in the 
following code:

```
<html>
  <head>
    <script type="text/javascript" 
src="https://www.google.com/jsapi";></script>
    <script type="text/javascript">
      google.load("visualization", "1.1", {packages:["bar"]});
      google.setOnLoadCallback(drawStuff);

      function drawStuff() {
        var data0 = [
          ['Canis Major Dwarf', 8000, 23.3, 8000, 23.3],
          ['Sagittarius Dwarf', 24000, 4.5, 24000, 4.5],
          ['Ursa Major II Dwarf', 30000, 14.3, 30000, 14.3],
          ['Lg. Magellanic Cloud', 50000, 0.9, 50000, 0.9],
          ['Bootes I', 60000, 13.1, 60000, 13.1]
        ];

        var header1 = [
          ['Galaxy', 'V1', {label: 'T1', role: 'tooltip'}, 'V2', {label: 
'T2', role: 'tooltip'}]
        ];

      var data = new google.visualization.arrayToDataTable(
      header1.concat(data0)
      );

        var options1 = {
          width: 900,
          chart: {
            title: 'Demo1',
            subtitle: 'data 1'
          }
        };

      var chart1 = new 
google.charts.Bar(document.getElementById('chart1_div'));
      chart1.draw(data, options1);

      var options2 = {
          width: 900,
          chart: {
            title: 'Demo2',
            subtitle: 'data 2'
          }
        };

      var chart2 = new 
google.charts.Bar(document.getElementById('chart2_div'));
      chart2.draw(data, options2);

      };
    </script>
  </head>
  <body>
    <div id="chart1_div" style="width: 900px; height: 500px;"></div>
    <div id="chart2_div" style="width: 900px; height: 500px;"></div>
  </body>
</html>
```

Thanks!

-- 
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/d/optout.

Reply via email to