通过npm安装:
1 | $ npm install frappe-charts |
并包含在您的项目中:
1 | import Chart from "frappe-charts/dist/frappe-charts.min.esm" |
...或包含在您的HTML中
1 2 3 | <script src= "./dist/frappe-charts.min.iife.js" ></script> <!-- or --> <script src= "./dist/frappe-charts.min.iife.js" ></script> |
用法
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | const data = { labels: [ "12am-3am" , "3am-6pm" , "6am-9am" , "9am-12am" , "12pm-3pm" , "3pm-6pm" , "6pm-9pm" , "9am-12am" ], datasets: [ { title: "Some Data" , type: "bar" , values: [25, 40, 30, 35, 8, 52, 17, -4] }, { title: "Another Set" , type: "line" , values: [25, 50, -10, 15, 18, 32, 27, 14] } ] } const chart = new Chart( "#chart" , { // or a DOM element title: "My Awesome Chart" , data: data, type: 'axis-mixed' , // or 'bar', 'line', 'scatter', 'pie', 'percentage' height: 250, colors: [ '#7cd6fd' , '#743ee2' ] }) |
特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com