如何为条形图ng2-chart添加角线边框

时间:2019-09-16 09:14:14

标签: angular bar-chart ng2-charts

我找不到在图表中为条形添加边框半径的方法,我在网上找到的解决方案与chartjs有关,但是我不确定如何使用ng2-charts来做到这一点

public barChartOptions: ChartOptions = {
        responsive: true,
        legend: {
            display: false,
        },
        curvature: 1,
        // We use these empty structures as placeholders for dynamic theming.
        scales: { xAxes: [{
            display:false,
            barThickness: 22,
            stacked: true
            }], yAxes: [{
            display:false,
            barThickness: 22,
            stacked: true
            }] },
    };
 public barChartLabels = ['2006', '2007', '2008', '2009', '2010', '2011', '2012'];
    public barChartType: ChartType = 'bar';
    public barChartData: ChartDataSets[] = [
        { data: [65, 59, 80, 81, 56, 55, 40] },
        { data: [28, 48, 40, 19, 86, 27, 90] }
    ];
    barChartColors: Color[] = [
        { backgroundColor: '#34bfa3' },
        { backgroundColor: '#f4f5f8' },
    ];


<canvas baseChart  height="100"
            [datasets]="barChartData"
            [labels]="barChartLabels"
            [options]="barChartOptions"
            [colors]="barChartColors"
            [chartType]="barChartType">
    </canvas>

我需要知道ng2-charts是否可以实现,以及如何实现?

0 个答案:

没有答案