可以在Google Charts中生成Char吗?

时间:2016-07-27 11:58:49

标签: charts google-visualization whitespace

我有一个快速的问题。可以在Google Charts中生成Char吗? ...而且你可能知道怎么做(任何建议或smth)? Chart1

图表下方的白色区域非常重要。

1 个答案:

答案 0 :(得分:0)

它可能

AreaChartisStacked: true一起使用,并将底部区域设为'transparent'

isStacked: true以来,很可能需要一些数据操作来获得所需的结果

请参阅以下工作代码段...



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>
&#13;
&#13;
&#13;

相关问题