php - 谷歌折线图添加货币符号
问题描述
是否可以在谷歌折线图中添加货币符号?
这是我的代码。
<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>
这是结果
我想在值中添加美元符号。
谢谢
解决方案
解决方案
var options = {
vAxis: {format: 'currency'}
};
推荐阅读
- javascript - 如何使用 Typescript 全局访问模块?
- console - 它允许通过谷歌购买在华为商店发布应用程序吗?
- python - 具有重复组名的正则表达式
- liquibase - Liquibase 数据库更改日志表
- reactjs - 使用 npx create-react-app 创建反应应用失败
- javascript - 如何使用 API 返回的多个字段构建表列?
- javascript - 在 laravel 中访问 javascript 变量
- python - Google Cloud Run for Anthos(Knative)未在 https 请求上正确设置 X-Forwarded-Proto 标头
- javascript - Next.JS“比上一次渲染时渲染了更多的钩子”
- jmeter - 在分布式设置中安装 JMeter 插件