Closed kbischop closed 6 years ago
I want to add a % sign to the google gauges. I found this example:
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([ ['Label', 'Value'], ['Memory', 80], ['CPU', 55], ['Network', 68] ]);
var formatter = new google.visualization.NumberFormat( {suffix: '%',pattern:'#'} );
formatter.format(data,1);
// Create and draw the visualization. new google.visualization.Gauge(document.getElementById('chart_div')). draw(data);
How can I do this with the google-chart polymer component. How can I access the internal datatable to add the formater ?
You'll want to create a DataTable yourself to do that. You can get one from the google-chart-loader element.
DataTable
google-chart-loader
I want to add a % sign to the google gauges. I found this example:
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([ ['Label', 'Value'], ['Memory', 80], ['CPU', 55], ['Network', 68] ]);
var formatter = new google.visualization.NumberFormat( {suffix: '%',pattern:'#'} );
formatter.format(data,1);
// Create and draw the visualization. new google.visualization.Gauge(document.getElementById('chart_div')). draw(data);
How can I do this with the google-chart polymer component. How can I access the internal datatable to add the formater ?