Bubble chart-reduce the size of the bubbles

2,236 views
Skip to first unread message

Jay Modha

unread,
Mar 20, 2013, 2:01:41 PM3/20/13
to google-visua...@googlegroups.com
How can i reduce the size of the bubbles in my bubble chart?

Help will be appreciated. Thanks

<html>
  <head>
    <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([
          ['ID', 'Life Expectancy', 'Fertility Rate', 'Region'],
          ['CAN',    80.66,              1.67,      'Europe' ],
          ['DEU',    79.84,              1.36,      'Europe'        ],
          ['DNK',    78.6,               1.84,      'Europe'         ],
          ['EGY',    72.73,              2.78,      'Europe'    ],
          ['GBR',    80.05,              2,         'Europe'         ],
          ['IRN',    72.49,              1.7,       'Middle East'    ],
          ['IRQ',    68.09,              4.77,      'Middle East'   ],
          ['ISR',    81.55,              2.96,      'Middle East'   ],
          ['RUS',    68.6,               1.54,      'Middle East'        ],
          ['USA',    78.09,              2.05,      'Middle East']
        ]);

        var options = {
          title: 'Correlation between life expectancy, fertility rate and population of some world countries (2010)',
          hAxis: {title: 'Life Expectancy'},
          vAxis: {title: 'Fertility Rate'},
          bubble: {textStyle: {fontSize: 11}}
        };

        var chart = new google.visualization.BubbleChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <div id="chart_div" style="width: 900px; height: 500px;"></div>
  </body>
</html>

asgallant

unread,
Mar 20, 2013, 3:18:45 PM3/20/13
to google-visua...@googlegroups.com
To control the maximum and minimum bubble sizes, use the sizeAxis.maxSize/minSize options.  You can assign values to the max/min with the sizeAxis.maxValue/minValue options.
Reply all
Reply to author
Forward
0 new messages