Joe
Joe

Reputation: 397

Google Line Chart add currency sign

is it possible to add currency sign in google line chart?

here is my code.

<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);

function drawChart() {
var data = google.visualization.arrayToDataTable([
  ['Month','Running'],
  <?php
    for($month=$fromdv;$month<=$todv;$month++){
        $monthv = date('M',strtotime($year[0].'-'.$month.'-1'));
        $fd = date('Y-m-d',strtotime($year[0].'-'.$month.'-1'));
        $td = date('Y-m-t',strtotime($fd));
        $running = get_running($team,$fd,$td,'alldevice','overall');
        echo "['".$monthv."',".$running."],";
    }
    ?>
]);

var options = {
  title: 'MOBILE APP SALES',
  curveType: 'none',
  legend: { position: 'bottom' }
};

var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));

chart.draw(data, options);
}
</script>

and here is the result

enter image description here

I want to add dollar sign in the value.

Thanks

Upvotes: 0

Views: 37

Answers (1)

Joe
Joe

Reputation: 397

Solution

var options = {
  vAxis: {format: 'currency'}
};

Upvotes: 1

Related Questions