簡體   English   中英

延遲chart.js的動畫

[英]Delay animation of chart.js

我是新來的,我的圖表會在頁面加載時自動啟動,所以我的問題是如何延遲動畫直到它進入視口,執行此操作的代碼是什么,以及將其確切地放置在chart.js中?

謝謝。

首先,您需要安裝:chartjs-插件遞延這里 ,然后添加到您的項目

plugins: {
    deferred: {           // enabled by default
        xOffset: 150,     // defer until 150px of the canvas width are inside the viewport
        yOffset: '50%',   // defer until 50% of the canvas height are inside the viewport
        delay: 500        // delay of 500 ms after the canvas is considered inside the viewport
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM