vue——echarts更换主题


链接:https://blog.csdn.net/Sunshine0508/article/details/90067437

//等配置安装好了以后

在main.js里引入echarts主题的js,一般在  node_modules---echarts---theme---macarons.js。  theme里边有各种各样的主题,任意选一种,这里我选的是macarons。引入:

import  'echarts/theme/macarons.js'
//此处可不加.js

在echarts初始化时,使用主题。

let myChart = this.$echarts.init(document.getElementById('myChart01'),'macarons');



在普通的html中引入主题时候:

官网上下载主题颜色的js文件(dark.js为例)
并在html里引用dark.js文件

<script src="js/dark.js" type="text/javascript" charset="utf-8"></script>
打开dark.js,找到图片的位置


然后添加在图形的js文件中

var myChart = echarts.init(document.getElementById('main'),'wonderland');
main是图形的id

ps:道理应该是可行的,但是我的一直报错

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM