Can Google Charts support dual y-axis (v-axis)?

It took me a while, to figure this out, but Google Charts does support dual Y-axis (v-axis). I want to use the Javascript API and not the HTML interface. This example can be tested here: http://code.google.com/apis/ajax/playground/?type=visualization#line_chart Replace all of that code with this code showing how to have two different Y-axis scales: function drawVisualization() { … Read more

Google chart redraw/scale on window resize

To redraw only when the window resize is completed and avoid multiple triggers, I think is better create an event: //create trigger to resizeEnd event $(window).resize(function() { if(this.resizeTO) clearTimeout(this.resizeTO); this.resizeTO = setTimeout(function() { $(this).trigger(‘resizeEnd’); }, 500); }); //redraw graph when window resize is completed $(window).on(‘resizeEnd’, function() { drawChart(data); });

Get image from Google API Chart

once the ‘ready’ has fired on the chart, you can use getImageURI to get a base 64 string, which can be saved as .PNG, or included in an img tag, as in the following example… to use a frozen version, you can replace ‘current’ with the latest save — ’45’ google.charts.load(‘current’, { callback: function () … Read more

How do I align date and values to gridlines in Google Chart?

Changing the date format (mm/dd/yyyy vs. yyyy-mm-dd) seems to get it to align… google.load(‘visualization’, ‘1’, { packages: [‘corechart’] }); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn(‘date’, ‘date’); data.addColumn(‘number’, ‘view’); data.addRows([ [new Date(’08/01/2015′), 5], [new Date(’08/02/2015′), 7], [new Date(’08/03/2015′), 2], [new Date(’08/04/2015′), 16], [new Date(’08/05/2015′), 3], [new Date(’08/06/2015′), 6], [new Date(’08/07/2015′), 1] ]); … Read more

How to avoid overlapping label’s on the Bar in google bar charts?

first, it appears you have an extra annotation column in your data, that doesn’t appear to belong to a specific column copied from question above… var data = new google.visualization.arrayToDataTable([ [ ‘Time Period’, ‘XYZ’, {role: ‘annotation’}, ‘ABC’, {role: ‘annotation’}, {role: ‘annotation’}, // <– extra annotation? ‘Average’ ], [ ‘Aug’, 3754, ‘3754’, 2089, ‘2089’, ‘5,843’, // … Read more

Google Visualization Charts API examples are broken, how to fix them?

Seems to be a bad release (v44). Until it is fixed, the workaround is to explicitly specify previous version of the API to load instead of using current: – google.charts.load(‘current’, {‘packages’:[‘gantt’]}); + google.charts.load(’43’, {‘packages’:[‘gantt’]}); Please note that this will indeed freeze your charts version and you will not get new features and bugfixes unless you … Read more

Download link for Google Spreadsheets CSV export – with Multiple Sheets

Every document in Google Sheets supports the “Chart Tools datasource protocol”, which is explained (in a rather haphazard way) in these articles: “Creating a Chart from a Separate Spreadsheet” “Query Language Reference” “Implementing the Chart Tools Datasource Protocol” To download a specific sheet as a CSV file, replace {key} with the document’s ID and {sheet_name} … Read more