Trouble with 'pretty' vAxis.viewWindowMode

678 views
Skip to first unread message

Ryan Clark

unread,
Apr 16, 2015, 7:19:50 PM4/16/15
to google-visua...@googlegroups.com
My code is below. The max and min bubbles are cut off, and I don't want them to be. Can anyone figure out what I'm doing wrong?

I've tried it with and without vAxis.viewWindowMode value, since the documentation says that 'pretty' behavior is the default.


    function drawSeriesChart() {

        var data = google.visualization.arrayToDataTable([
            ['ID', 'Sequence', 'Average Time (ms)', 'Iterations', 'Std Dev'],
            ['Harry Potter', 1, 822000, '200', 0.029200],
            ['Data Set 2', 2, 819000, '200', 0.033400],
            ['Ronald McDonald', 3, 814000, '10', 0.021700], ]);
        var options = {
            title: 'my_test',
            legend: 'none',
            hAxis: {
                title: 'Data Source'
            },
            vAxis: {
                title: 'Average Time (ms)',
                viewWindowMode: 'pretty'
            }
        };

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



Sergey Grabkovsky

unread,
Apr 17, 2015, 10:21:38 AM4/17/15
to google-visua...@googlegroups.com
Hi Ryan,

'pretty' mode doesn't change whether your bubbles are cut off. It simply changes which gridlines are shown. 'pretty' mode will expand the view window to the nearest 'nice' tick. You will have to set the viewWindow.min/max options explicitly in order to better control how things are cut off. We don't yet have a mode that will automatically avoid cropping bubbles. This is a surprisingly difficult problem.

--
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.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages