Chart.js timescale: set min and max on xAxes

后端 未结 2 837
故里飘歌
故里飘歌 2021-01-01 23:35

How can I set a min and max on the xAxes? It works fine on the yAxes but on the xAxes it shows no behavior.

My xAxes

相关标签:
2条回答
  • 2021-01-02 00:13

    This was changed in 3.0

    https://www.chartjs.org/docs/next/getting-started/v3-migration#options

    scales.[x/y]Axes.time.max was renamed to scales[id].max
    scales.[x/y]Axes.time.min was renamed to scales[id].min
    
    0 讨论(0)
  • 2021-01-02 00:21

    The properties you are looking for actually are in the time attribute :

    options: {
        scales: {
            xAxes: [{
                type: "time",
                time: {
                    min: 1471174953000,
                    max: 1473853353000
                }
            }]
        }
    }
    
    0 讨论(0)
提交回复
热议问题