var options = {
width: 400, height: 400,
greenFrom: 0, greenTo: sales,
minorTicks: 5, max: dayTarget
};
var options = {
width: 400, height: 400,
greenFrom: 0, greenTo: sales,
minorTicks: 5, max: dayTarget,
animation:{duration: 5000, easing: 'inAndOut'}
};
--
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.
OK, I've got that working bar one thing: the value shown in the gauge changes, but the label does not. So the pointer climbs to [value] but the big letters say the value is 0.
<!-- ------------------------ make Code for Today graph ------------------------------- -->// format column 1 of DataTable data
google.setOnLoadCallback(drawChart);
function drawChart() {
var sales = @todaySales;
var dayTarget = @dailyTarget;
var apdTarget = 22500;
var green = 0;
if (sales < 0) {green = 0} else {green = sales};
var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
['Today', 0],
]);
var formatter = new google.visualization.NumberFormat({pattern: '$#,###.00'});
formatter.format(data, 1);
var options = {
width: 400, height: 400,
greenFrom: 0, greenTo: green,
minorTicks: 5, max: dayTarget,
animation: {duration: 5000, easing: 'inAndOut'}
};
var chart = new google.visualization.Gauge(document.getElementById('daily_Sales'));
chart.draw(data, options);
data.setValue(0,1, sales);
chart.draw(data, options);
};
--