【问题标题】:Chart.js - Line chart does not render all points when using Point[] formatChart.js - 使用 Point[] 格式时折线图不呈现所有点
【发布时间】:2019-08-08 15:50:40
【问题描述】:

Charts.js 在使用Point[] 格式时不会渲染所有数据点。

Codepen example

问题:

  1. 为什么每个数据集只呈现四分之二的数据点?
  2. 为什么 X 轴上没有刻度?
  3. 为什么点悬停时显示“未定义”字符串?
  4. 如何在点悬停时同时显示 X 和 Y 值?

谢谢!

【问题讨论】:

    标签: chart.js


    【解决方案1】:

    添加“比例”选项解决了问题:

        scales: {
          xAxes: [{
            type: 'linear',
            position: 'bottom',
          }]
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-18
      • 2017-07-26
      相关资源
      最近更新 更多