Search code examples
timechart.jsrenderingseriessmoothing

chartjs - no smooth rendering on time series plot


On basic chartjs line plot https://www.chartjs.org/samples/latest/charts/line/basic.html the chart animates (i.e. renders smoothly) when the "Randomize Data" button is clicked.

But the time series plot here https://www.chartjs.org/samples/latest/scales/time/financial.html doesn't render smoothly when the "Update" button is clicked.

How can smooth rendering be achieved on the time series plot.

Thanks.


Solution

  • To have smooth rendering, you need to define/increase the animation.duration option.

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

    duration: The number of milliseconds an animation takes.