我有 angular2 和谷歌图表。
我的组件代码是:
playstoreRatingChart(data) {
let dateTitle: any = 'Date';
let ratingTitle: any = 'Rating';
let dataTable = [[dateTitle, ratingTitle, { "role": 'annotation' }, { role: 'style' }]];
data.playstore_rating.forEach(function (obj) {
let newDate = new Date(obj.year, obj.month-1, obj.day)
let rating = obj.rating;
let rowRating = Number(rating.toFixed(2));
let test = parseFloat(rating.toFixed(2));
let row = [newDate, test, test, 'width:22; stroke-color: #871B47; stroke-opacity: 0.6; stroke-width: 12; fill-color: #BC5679; fill-opacity: 0.2'];
dataTable.push(row)
});
this.testPlayStore = {
chartType: 'ColumnChart',
dataTable: dataTable,
bar: { groupWidth: '100%' }
}
}
我不知道,为什么,但正是这个图表(我在这个页面上还有几个图表)有 1px 宽度的列,我不能改变它的宽度。