回答

0

圖表似乎默認

糾正被使用「常規」格式,爲每個軸一個特定format ...

 options: { 
     hAxis: { 
      format: '0' 
     }, 
     vAxis: { 
      format: '#,##0' 
     } 
     }, 

看到下面的工作片段...

google.charts.load('current', { 
 
    packages: ['controls', 'corechart', 'table'] 
 
}).then(function() { 
 
    var query = new google.visualization.Query('https://docs.google.com/spreadsheets/d/1PlT8k6qXsCkOCEEJFn7apKYgDunLi1Lzmnmo_AKQBXc/edit#gid=0'); 
 
    query.send(handleQueryResponse); 
 

 
    function handleQueryResponse(response) { 
 
    if (response.isError()) { 
 
     console.log('Error: ' + response.getMessage() + ' ' + response.getDetailedMessage()); 
 
     return; 
 
    } 
 

 
    var data = response.getDataTable(); 
 

 
    var control = new google.visualization.ControlWrapper({ 
 
     controlType: 'NumberRangeFilter', 
 
     containerId: 'control', 
 
     options: { 
 
     filterColumnIndex: 1, 
 
     ui: { 
 
      format: { 
 
      pattern: '0' 
 
      } 
 
     } 
 
     } 
 
    }); 
 

 
    var chart = new google.visualization.ChartWrapper({ 
 
     chartType: 'ColumnChart', 
 
     containerId: 'chart', 
 
     options: { 
 
     hAxis: { 
 
      format: '0' 
 
     }, 
 
     vAxis: { 
 
      format: '#,##0' 
 
     } 
 
     }, 
 
     view: { 
 
     columns: [1, 2] 
 
     } 
 
    }); 
 

 
    var dashboard = new google.visualization.Dashboard(document.getElementById('dashboard')); 
 
    dashboard.bind(control, chart); 
 
    dashboard.draw(data); 
 
    } 
 
});
<script src="https://www.gstatic.com/charts/loader.js"></script> 
 
<div id="dashboard"> 
 
    <div id="control"></div> 
 
    <div id="chart"></div> 
 
</div>

+0

這個問題有什麼好運? – WhiteHat