我已在angular

时间:2019-11-22 19:04:26

标签: angular angular-material

我想从我的图表中删除此水平滚动条。我如何从图片中提到的图表中删除滚动条。

谢谢

enter image description here

html代码:

<canvas id="barChart" height="5" width="20"></canvas>

.ts代码:

options: {
                title: {
                    text: "Bar Chart",
                    display: true
                },
                scales: {
                    xAxes: [{
                        gridLines: {
                            display:false,

                        }
                    }],
                    yAxes: [{
                        gridLines: {
                            display:false
                        },   
                    }]
                },
                legend: {
                    onHover: function (e) {
                        e.target.style.cursor = 'pointer';
                    }
                },
                hover: {
                    onHover: function (e) {
                        var point = this.getElementAtEvent(e);
                        if (point.length) e.target.style.cursor = 'pointer';
                        else e.target.style.cursor = 'default';
                    }
                },
                tooltips: {
                    mode: 'index'
                }
            }

1 个答案:

答案 0 :(得分:0)

尝试添加

options : {
    responsive: true,
    maintainAspectRatio: false,
     .
     .
     . 
}

删除html中的高度和宽度