chartjs : how to set custom scale in bar chart

后端 未结 3 1645
眼角桃花
眼角桃花 2020-12-31 07:47

Chartjs is a pretty excellent open source tool, but had a quick question about a bar chart I\'m trying to create. Given this chart data:

    var chartData =          


        
3条回答
  •  执笔经年
    2020-12-31 08:42

    @2.8.0 custom y-axis setup. You only need range min/max and with stepSize you control the axis.

    ...
    yAxes: [{
            ticks: {
                stepSize: 0.1,
                min: 2,
                max: 2.5
                },
            gridLines: {
                display: false 
                },
            stacked: false
                        }]
     ...
    

提交回复
热议问题