【发布时间】:2020-05-10 22:13:05
【问题描述】:
我是在我的应用程序中使用 ng2-charts 的新手,我想知道是否可以将 Y 轴的最大值增加 5,这样我的条形图的顶部就不会一直到达顶部的图表。目前,当我的最大值为 90 时,我的 Y 轴的最大值也是 90,这会导致一些视觉上不愉快的重叠。
我目前使用的是文档中的默认代码,如下:
public barChartOptions: ChartOptions = {
responsive: true,
scales: { xAxes: [{}], yAxes: [{}] }
};
public barChartLabels: Label[] = [
'2006',
'2007',
'2008',
'2009',
'2010',
'2011',
'2012'
];
public barChartType: ChartType = 'bar';
public barChartLegend = true;
public barChartData: ChartDataSets[] = this.fetchData();
public changeChart(): void {
this.barChartType = this.barChartType === 'bar' ? 'line' : 'bar';
}
【问题讨论】:
标签: angular charts ng2-charts