在 ng2-google-charts 中调整图表大小
chart resizing in ng2-google-charts
我使用此文档创建了一个图表 https://www.npmjs.com/package/ng2-google-charts。
<google-chart style="height: 100%!important; width: 80%!important;" [data]="pieChartData"></google-chart>
大屏幕显得很小。无论如何我可以调整它的大小以适应大屏幕吗?
您可以只在选项中指定宽度和高度的值。但是没有响应。
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},
};
我使用此文档创建了一个图表 https://www.npmjs.com/package/ng2-google-charts。
<google-chart style="height: 100%!important; width: 80%!important;" [data]="pieChartData"></google-chart>
大屏幕显得很小。无论如何我可以调整它的大小以适应大屏幕吗?
您可以只在选项中指定宽度和高度的值。但是没有响应。
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},
};