echarts——引入自定义主题

主题编辑器 - Apache ECharts编辑主题

下载主题(此处示例JSON版本),代码复制到 mytheme.js 文件中,文件名与主题名保持一致。

export const mytheme = {
    
    
	//复制的代码
}

引入 mytheme.js 文件

import {
    
     mytheme } from '../../js/mytheme.js'

在初始化 echarts 实例前注册主题

//注册自定义主题
echarts.registerTheme("mytheme", mytheme);

初始化echarts实例,使用主题

let myChart = echarts.init(document.getElementById("main"), "mytheme");

猜你喜欢

转载自blog.csdn.net/weixin_44001906/article/details/125667921
今日推荐