Re: geochart marker size and colour?

2,850 views
Skip to first unread message

asgallant

unread,
Aug 8, 2012, 2:31:50 PM8/8/12
to google-visua...@googlegroups.com
Marker size is determined by the relative differences between data points (ie, the smallest value gets the smallest marker, while the largest value gets the largest marker, and everything in between scales linearly).  When all the marker values are the same, the API assigns each point an average-size marker - there is no way to tell the API how big "average-size" should be, though.

As far as color-index, you need to assign colorAxis.minValue and colorAxis.maxValue so the API can know where 0 falls in the scale.

On Wednesday, August 8, 2012 11:05:48 AM UTC-4, daxu wrote:
Hello everyone,

Very new to google geo chart. From the document, it says that I can set marker size and colour (in the markers Mode format section).

However, I can't make it work.

My script:
<script type="text/javascript">

        google.load('visualization', '1', { 'packages': ['geochart'] });
        google.setOnLoadCallback(drawRegionsMap);

        function drawRegionsMap() {

          var data = new google.visualization.DataTable();

    data.addColumn('number');
    data.addColumn('number');
    data.addColumn('number');
    data.addColumn('number');

var markersize = 4;
var markercolour = 0;
    data.addRows([
[41.8776, -87.6272, markercolour , markersize],
[39.97919999999999, 116.29919999999998,markercolour , markersize ],
[56.0, 10.0, markercolour , markersize],
[62.0, 15.0, markercolour ,markersize ]
    // data truncated for posting
    ]);


            var options = {
                displayMode: 'markers',
                datalessRegionColor: 'd1dedf',
                colorAxis: {colors: ['red','green']}
            };

            var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));
            chart.draw(data, options);
        }
    </script>

Seems doesn't matter if I set it to 4 or 24, the markers are the same size, also it ignores the colour index.

Can someone help?

Many Thanks

Firdan Machda

unread,
Oct 30, 2012, 5:00:07 AM10/30/12
to google-visua...@googlegroups.com
is it possible to give a minimum size for the marker?

asgallant

unread,
Oct 30, 2012, 12:03:08 PM10/30/12
to google-visua...@googlegroups.com
Set the sizeAxis.minSize option; this takes an integer value which sets the minimum size of a marker in pixels (default is 3), eg:

sizeAxis: {
    minSize: 6 // set the minimum size of a marker to be 6 pixels
Reply all
Reply to author
Forward
0 new messages