0
看到在2004年我有1000个值,而在其他年份我有大的值,因此在规模图表似乎并不能够渲染,什么都可以我确实要显示这些值。我在读this。有没有办法在谷歌图表中做这样的事情?
下面是代码
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'Sales', 'Expenses'],
['2004', 1000, 1000],
['2005', 1170000, 460000],
['2006', 660000, 1120000],
['2007', 1030000, 540000]
]);
var options = {
title: 'Company Performance',
hAxis: {title: 'Year', titleTextStyle: {color: 'red'}}
};
var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="chart_div" style="width: 900px; height: 500px;"></div>
</body>
</html>
图表
有一个logScale选项,但仍然也不会转回去工作,为价值1 – juvian 2014-10-09 18:01:23
@juvian我将值更改为1000,并将3个零添加到其他数字,可以评论你的想法 – 2014-10-10 12:41:12
'vAxis:{title:'Year',titleTextStyle:{color:'red'},logScale:true}' – juvian 2014-10-10 15:30:48