简体   繁体   English

谷歌折线图添加货币符号

[英]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这是结果

在此处输入图像描述

I want to add dollar sign in the value.我想在值中添加美元符号。

Thanks谢谢

Solution解决方案

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM