ComboChart vAxes title and max values

180 views
Skip to first unread message

mark m

unread,
Oct 9, 2015, 1:23:05 PM10/9/15
to Google Visualization API
Starting with the jfiddle example for a combo chart I modified the format to show 2 vertical axes here...

But I cant get the axis title or max values to behave ...

      google.setOnLoadCallback(drawVisualization);

      function drawVisualization() {
        // Some raw data (not necessarily accurate)
        var data = google.visualization.arrayToDataTable([
         ['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua New Guinea', 'Rwanda', 'Percent'],
         ['2004/05',  165,      938,         522,             998,           450,      20],
         ['2005/06',  135,      1120,        599,             1268,          288,      30],
         ['2006/07',  157,      1167,        587,             807,           397,      55],
         ['2007/08',  139,      1110,        615,             968,           215,      68],
         ['2008/09',  136,      691,         629,             1026,          366,      45]
      ]);

    var options = {
      title : 'Monthly Coffee Production by Country',
      //vAxis: {title: 'Cups'},
      hAxis: {title: 'Month'},
      seriesType: 'bars',
      series: {5: {targetAxisIndex:1,type: 'line'}},
      vAxes: [{0:{title: "cups", viewWindow:{ min:0.0, max: 1400.0}}},{1:{title: "Pct", viewWindow:{ min:0.0, max: 100.0}}}],
    };

    var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
    chart.draw(data, options);
  }

Any ideas?

Thanks,

Daniel LaLiberte

unread,
Oct 9, 2015, 1:30:55 PM10/9/15
to Google Visualization API
The vAxes option should be an object, not an array of objects.  I updated your jsfiddle example: https://jsfiddle.net/xajv39q9/7/

--
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 google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/aba6bf48-7a70-4fb6-8b92-07021b9dd9b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
dlaliberte@Google.com   5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA

mark m

unread,
Oct 9, 2015, 1:38:00 PM10/9/15
to Google Visualization API
HA!  Found one of Andrews old answers.

 FYI:
 
vAxes: [{0:{title: "cups", viewWindow:{ min:0.0, max: 1400.0}}},{1:{title: "Pct", viewWindow:{ min:0.0, max: 100.0}}}],

should be


vAxes: {0:{title: "cups", viewWindow:{ min:0.0, max: 1400.0}},1:{title: "Pct", viewWindow:{ min:0.0, max: 100.0}}},


mark m

unread,
Oct 12, 2015, 10:40:39 AM10/12/15
to Google Visualization API
Thanks Daniel!


On Friday, October 9, 2015 at 12:23:05 PM UTC-5, mark m wrote:
Reply all
Reply to author
Forward
0 new messages