how do i change pointSize based on the value

29 views
Skip to first unread message

kostja wolf

unread,
Jan 26, 2018, 6:43:40 AM1/26/18
to Google Visualization API
it is possible to change the pointSize based on the value?

if value > 20 set pointSize: 20

if value < 10 set pointSize: 10

or

if value == 30 set pointSize: 30


        google.charts.load('current', {'packages':['corechart']});
          
        google.charts.setOnLoadCallback(drawChart);
     
        function drawChart() {
        
            var jsonData = $.ajax({
                url: "getData.php",
                dataType: "json",
                async: false
                }).responseText;

            var options = {
                width: 2500,
                height: 1080,
                legend: { position: 'top', maxLines: 10 },
                bar: { groupWidth: '75%' },
                isStacked: true,
                title: '15-tägiger Wettbewerb, 17.01.2018 - 06.02.2018',
                titlePosition: 'out',
                colors: ['green', '#e6693e', 'blue'],
                backgroundColor: 'white',
                tooltip: { trigger: 'selection' },
                legend: { position: 'none' },
                vAxis: { viewWindowMode:'explicit', viewWindow: { max: 130}},
                seriesType: 'bars',
                series: {   3: {type: 'scatter', pointSize: 30, color: 'black'},
                                4: {type: 'scatter', pointSize: 30, color: 'black'},
                                5: {type: 'scatter', pointSize: 30, color: 'black'},
                                6: {type: 'scatter', pointSize: 30, color: 'black'},
                 },
                pointShape: 'star',
            };
            
            var data = new google.visualization.DataTable(jsonData);
           
            var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
            chart.draw(data, options);
        }

Daniel LaLiberte

unread,
Jan 26, 2018, 9:35:15 AM1/26/18
to Google Visualization API
Hi Kostja,

The only way to do what you want now is to use a 'style' role column.  Since you have several series, you would have to add another style role column after each series column.


--
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-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/905254df-3652-4f7b-ae8e-dc679de8a0a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages