谷歌图表中可以生成Char? [英] It is possible to generate that Char in Google Charts?
本文介绍了谷歌图表中可以生成Char?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Chart1
图表下方的白色区域非常重要。
解决方案
使用 AreaChart
与 isStacked:true
并将底部区域设置为'transparent'
既然 isStacked:true
,很可能需要一些数据操作才能获得所需的结果
请参阅以下工作片段...
google.charts.load('current',{callback:function(){new google.visualization.AreaChart(document.getElementById('chart_div'))。draw(google.visualization。 arrayToDataTable([['年','底部','区域1','区域2','区域3'],['2010',100,100,100,100],['2020',110,120,130,140],['2025',120,160,180,200],['2030 ['2040',260,300,320,380],['2045',320,400,460, 600],['2050',400,480,600,800]]),{areaOpacity:1.0,colors:['transparent','cyan','yellow','magenta'],lineWidth:1,isStacked: true,series:{0:{visibleInLegend:false}}}); },packages:['corechart']});
I have a fast question. It is possible to generate that Char in Google Charts? ... And mayby u knew how to do that (any advice or smth)? Chart1
This white area below the chart is very important.
解决方案
it's possible
use AreaChart
with isStacked: true
and set the bottom area to 'transparent'
since isStacked: true
, most likely some data manipulation will be required to get the desired outcome
see following working snippet...
google.charts.load('current', {
callback: function () {
new google.visualization.AreaChart(document.getElementById('chart_div')).draw(
google.visualization.arrayToDataTable([
['Year', 'Bottom', 'Area 1', 'Area 2', 'Area 3'],
['2010', 100, 100, 100, 100],
['2020', 110, 120, 130, 140],
['2025', 120, 160, 180, 200],
['2030', 140, 180, 200, 240],
['2035', 200, 240, 280, 320],
['2040', 260, 300, 320, 380],
['2045', 320, 400, 460, 600],
['2050', 400, 480, 600, 800]
]),
{
areaOpacity: 1.0,
colors: ['transparent', 'cyan', 'yellow', 'magenta'],
lineWidth: 1,
isStacked: true,
series: {
0: {
visibleInLegend: false
}
}
}
);
},
packages: ['corechart']
});
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>
这篇关于谷歌图表中可以生成Char?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文