gpt4 book ai didi

charts - 具有多个条形图和线条的 Google 组合图

转载 作者:行者123 更新时间:2023-12-01 13:43:20 25 4
gpt4 key购买 nike

看这张图片,我正在展示一些数据,我必须将每个条形图与折线图显示的数据进行比较:

google combo chart bar + line graph

这在 Google 组合图中可能吗?

最佳答案

确定这是可能的,看下面的例子......

google.charts.load('current', {
callback: function () {
var data = google.visualization.arrayToDataTable([
['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua New Guinea', 'Rwanda', 'Average'],
['2004/05', 165, 938, 522, 998, 450, 614.6],
['2005/06', 135, 1120, 599, 1268, 288, 682],
['2006/07', 157, 1167, 587, 807, 397, 623],
['2007/08', 139, 1110, 615, 968, 215, 609.4],
['2008/09', 136, 691, 629, 1026, 366, 569.6]
]);

var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
chart.draw(data, {
title : 'Monthly Coffee Production by Country',
vAxis: {title: 'Cups'},
hAxis: {title: 'Month'},
height: 420,
orientation: 'vertical',
seriesType: 'bars',
series: {
5: {
pointSize: 5,
type: 'line'
}
}
});
},
packages: ['corechart']
});
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>

关于charts - 具有多个条形图和线条的 Google 组合图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38016999/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com