【问题标题】:chartJS label on each side of the chart图表每一侧的chartJS标签
【发布时间】:2018-08-24 06:58:33
【问题描述】:

我正在尝试使用竖线在 django 应用程序中设置 Chart.js,但我无法使用标签。我的数据在 [-100;+100] 范围内,我希望能够在图表顶部显示一个标签,在底部显示另一个标签。

现在我只设法将标签放在图表的底部.. enter image description here

并且需要它看起来像这样: enter image description here

知道如何实现吗? 拉斐尔

【问题讨论】:

    标签: javascript chart.js


    【解决方案1】:

    在 options 对象内部,添加两个 xAxes 刻度:

    scales: {
        xAxes: [{
            display: true,
            position: 'top'
        },{
            display: true,
            position: 'bottom'
        }]
    }
    

    websitegithub上有很多例子

    【讨论】:

      猜你喜欢
      • 2022-01-23
      • 2017-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-17
      相关资源
      最近更新 更多