3

我的图表是这样的:

在此处输入图像描述

我想显示像印度格式的金额而不是百万/十亿我想显示千/十万/千万,并且在工具提示中显示为“27,98,99,811.34”

提前致谢..

4

1 回答 1

0

要加载针对特定语言环境格式化的图表,请使用语言参数:

google.charts.load('current', {
  callback: function () {//},
  language: 'hi_IN',
  packages:['corechart']
});

看下面的例子...

google.charts.load('current', {
  callback: function () {
    var dataTable = new google.visualization.DataTable({
      cols: [
        {label: 'Month', type: 'string'},
        {label: 'Amount', type: 'number'}
      ],
      rows: [
        {c:[{v: 'April'}, {v: 279899811.34}]},
        {c:[{v: 'May'}, {v: 205855811}]},
        {c:[{v: 'June'}, {v: 10009811}]},
        {c:[{v: 'July'}, {v: 79979811}]},
        {c:[{v: 'August'}, {v: 175789911}]},
        {c:[{v: 'September'}, {v: 99899811}]},
        {c:[{v: 'October'}, {v: 149899811}]},
        {c:[{v: 'November'}, {v: 80899811}]},
        {c:[{v: 'December'}, {v: 60899811}]},
        {c:[{v: 'January'}, {v: 225899811}]},
        {c:[{v: 'February'}, {v: 148899811}]},
        {c:[{v: 'March'}, {v: 150899811}]}
      ]
    });

    var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
    chart.draw(dataTable, {
      vAxis: {
        format: 'short'
      },
      legend: 'none'
    });
  },
  language: 'hi_IN',
  packages:['corechart']
});
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>

于 2016-06-27T11:52:33.337 回答