Chart.js offsetGridLines:如何将第一行粘在底部,将第一列粘在左边?

问题描述

我正在使用 Chart.js 2.0 构建气泡图。每个气泡都有一个 x 和 y 值,从 1 到 5,步长为 1。

我需要将第一列粘在左边,第一行粘在底部,轴上没有显示 0。我使用 offsetGridLines 效果很好,但第一列/行不粘在左边/底部(见下面的截图)。

我对最后一行和最后一列有同样的问题。

怎么做?

scales: {
            yAxes: [{
                scaleLabel: {
                    display: true,labelString: "Probabilité"
                },ticks: {
                    min: 0,// Controls where axis starts
                    max: 6,// Controls where axis finishes
                    stepSize: 1,display: true,callback: function (tick) {
                        return (tick !== 0) && (tick !== 6) ? tick : '';
                    }
                },gridLines: {
                    display: true,drawBorder: false,offsetGridLines: true,color: '#D2D5D5',}
            }],xAxes: [{
                scaleLabel: {
                    display: true,labelString: "Impact"
                },color: '#d2d5d5',}
            }]
        },

Blue arrows show the line and column I would like to delete

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)