【问题标题】:chartjs - no smooth rendering on time series plotchartjs - 时间序列图上没有平滑渲染
【发布时间】:2020-09-08 04:07:25
【问题描述】:

关于基本的chartjs线图 https://www.chartjs.org/samples/latest/charts/line/basic.html 单击“随机数据”按钮时,图表会动画(即平滑渲染)。

但是这里的时间序列图 https://www.chartjs.org/samples/latest/scales/time/financial.html 单击“更新”按钮时渲染不流畅。

如何在时间序列图上实现平滑渲染。

谢谢。

【问题讨论】:

    标签: time chart.js rendering series smoothing


    【解决方案1】:

    要平滑渲染,您需要定义/增加animation.duration 选项。

    options: {
      animation: {
        duration: 2000
      },
      ...
    

    duration:动画所用的毫秒数。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-11
    • 1970-01-01
    • 2010-11-13
    • 2014-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多