图表在ng2-google-charts中调整大小

问题描述 投票:0回答:1

我使用此文档https://www.npmjs.com/package/ng2-google-charts创建了一个图表。

<google-chart style="height: 100%!important; width: 80%!important;" [data]="pieChartData"></google-chart>

对于大屏幕来说它看起来很小。无论如何我可以调整大屏幕的大小吗? enter image description here

charts google-visualization angular5
1个回答
1
投票

您可以在选项中指定宽度和高度的值。但它没有响应。

pieChartData =  {
  chartType: 'PieChart',
  dataTable: [
    ['Task', 'Hours per Day'],
    ['Work',     11],
    ['Eat',      2],
    ['Commute',  2],
    ['Watch TV', 2],
    ['Sleep',    7]
  ],
  options: {'title': 'Tasks', 
            'width': 700,
            'height': 600},
};
© www.soinside.com 2019 - 2024. All rights reserved.