1.首先引入ucharts配置文件,這是我項(xiàng)目放置的目錄
image.png
ucharts官網(wǎng):https://www.ucharts.cn/
ucharts 在線配置文檔:https://demo.ucharts.cn/#/
ucharts 組件下載:https://ext.dcloud.net.cn/plugin?id=271
組件下載完后的目錄
image.png
然后把components和js_sdk放在自己的項(xiàng)目中
2.頁面布置
在<script></script>中引入charts組件
image.png
image.png
<template></template>中寫入
image.png
其中這里寫了type="history-DX"结啼,這個是自定義的圖表名稱掠剑,其對應(yīng)引入的js_sdk中的
image.png
這個文件里寫了history-DX的配置,這個對象里的具體配置就可以用ucharts 在線配置文檔:https://demo.ucharts.cn/#/郊愧,調(diào)整好自己想要的效果后朴译,直接復(fù)制到這里就可以了
image.png
記得在上面引入
image.png
3.如果js_sdk中的config-ucharts.js的一些配置是數(shù)據(jù)變量怎么辦?
qiun-data-charts組件參數(shù)中opts支持自定義配置參數(shù)
組件基本API參數(shù):https://gitee.com/uCharts/uCharts?utm_source=alading&utm_campaign=repo