1

MVC 4.0 と chart.JS を使用してグラフを生成しています。各値にY軸の水平線を入れたいのですが、以下のプロパティを使用して展開することに成功しました。

scaleShowGridLines = true;
scaleShowHorizontalLines: true,
//Boolean - Whether to show vertical lines (except Y axis)
scaleShowVerticalLines: false,

しかし、私の実際の要件は、水平線の色を変えたいということです。

scaleGridLineColor: "rgba(0,0,0,.05)"

上記の線は水平線の色を変更しますが、すべての線に適用されます。

私を案内してください。

4

2 に答える 2

1

You can set individual colors for the horizontal and vertical gridlines by adding a scales configuration to your options:

scales: {
    yAxes: [{
        gridLines: {
            color: 'green'
        }
    }],
    xAxes: [{
        gridLines: {
            color: 'red'
        }  
    }]
}
于 2016-11-10T18:13:24.607 に答える