Hello,
I have the following:
<script type="text/javascript">
google.load("visualization", "1", {packages:["gauge"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var sales = @todaySales;
var dayTarget = @dailyTarget;
var apdTarget = 22500;
var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
['Today', sales],
]);
var options = {
width: 400, height: 400,
redFrom: 0, redTo: apdTarget,
greenFrom: apdTarget, greenTo: dayTarget,
minorTicks: 5, max: dayTarget
};
var chart = new google.visualization.Gauge(document.getElementById('daily_Sales'));
chart.draw(data, options);
};
Now, I want to format the value to a currency, $12.34.
The variable 'sales' is a numerical value to 10 decimal places extracted from an SQL database with aspx prior to this gauge code, declared as @todaySales
I want to format the label and tried this:
['Label', 'Value'],
['Today', {v: sales, f: 'C']]
uh, No.
What can I do?