1、安装echarts
npm i echarts -S
2、在main.js里引入 echarts 主题的 js(一般在 node_modules---echarts---theme---macarons.js)
theme里边有各种各样的主题,任意选一种,例如:macarons,然后引入:
import 'echarts/theme/macarons.js'
// 或者
require('echarts/theme/macarons')
3、在echarts初始化时,使用主题
let myChart = echarts.init(document.getElementById('myChart'), 'macarons');
本文详细介绍了如何在项目中安装并使用ECharts图表库,包括通过npm安装ECharts,如何在main.js文件中引入ECharts的主题js文件,以及在初始化ECharts时设置主题的具体步骤。
403

被折叠的 条评论
为什么被折叠?



