【发布时间】:2016-07-27 11:58:48
【问题描述】:
我有一个快速的问题。可以在 Google 图表中生成该字符吗? ......也许你知道怎么做(任何建议或smth)? Chart1
图表下方的这个白色区域非常重要。
【问题讨论】:
标签: javascript charts google-visualization whitespace
我有一个快速的问题。可以在 Google 图表中生成该字符吗? ......也许你知道怎么做(任何建议或smth)? Chart1
图表下方的这个白色区域非常重要。
【问题讨论】:
标签: javascript charts google-visualization whitespace
有可能
使用AreaChart 和isStacked: true 并将底部区域设置为'transparent'
因为isStacked: true,很可能需要一些数据操作才能获得预期的结果
请参阅以下工作 sn-p...
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>
【讨论】: