Hi Andrew,

Thanks for sharing; I'm not quite there with your example though.

Please see my code, which is just the example area chart code from the 
Google

I'd just like three of the same chart:

    <script type="text/javascript" 
src="https://www.google.com/jsapi";></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Date', 'Impressions'],
  ['2014-07-01',  1850],
  ['2014-07-02',  1950],
  ['2014-07-03',  2100],
  ['2014-07-04',  1900],
          ['2014-07-05',  2000],
          ['2014-07-06',  2170],
          ['2014-07-07',  1660],
          ['2014-07-08',  2030],
  ['2014-07-09',  2130],
  ['2014-07-10',  2230]
        ]);
      
        var options = {
          hAxis: {textPosition: 'none'},
          vAxis: {
textPosition: 'none',
gridlines: {color:'transparent'},
baselineColor:'transparent',
minValue: 0
  },
  theme: 'maximized',
  legend: 'none'
        };
      
        var chart = new 
google.visualization.AreaChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>


On Thursday, July 31, 2014 9:17:50 PM UTC-7, Andrew Gallant wrote:
>
> There are many ways to include multiple charts on the same page.  The 
> thing they all share in common are that each chart has to have a unique 
> container div, so if I create 3 charts on a page, I might put them in 3 
> container divs with id's "chart1", "chart2", and "chart3".  You can 
> separate out the code for each chart into its own function, or you can 
> combine them all together, eg:
>
> function drawCharts () {
>     // code to draw chart1
>     
>     // code to draw chart2
>     
>     // code to draw chart3
> }
> google.load('visualization', '1', {packages: ['corechart'], callback: 
> drawCharts});
>
> is functionally equivalent to:
>
> function drawChart1 () {
>     // code to draw chart1
> }
>
> function drawChart2 () {
>     // code to draw chart2
> }
>
> function drawChart3 () {
>     // code to draw chart3
> }
>
> function drawCharts () {
>     drawChart1();
>     drawChart2();
>     drawChart3();
> }
> google.load('visualization', '1', {packages: ['corechart'], callback: 
> drawCharts});
>
> Is that what you are looking for?
>
> On Thursday, July 31, 2014 5:46:24 PM UTC-4, WhoSoLovesUs wrote:
>>
>> Hi,
>>
>> To someone familiar and comfortable with javascript this may seem like an 
>> easy task...
>>
>> But I'd like to put three charts on the same web page
>>
>> Is there any official documentation from Google about what to do in this 
>> case?
>>
>> I've looked online a fair bit; the problem is that every individual 
>> solution looks a little different to my eyes (not surprisingly)
>>
>> Thanks, basically I'm looking for some hand holding and explanation here 
>> :)
>>
>

-- 
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