echarts - import custom theme

Edit theme in theme editor - Apache ECharts

Download the theme (here is the example JSON version), copy the code to the mytheme.js file, and keep the file name consistent with the theme name.

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

Import mytheme.js file

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

Register the theme before initializing the echarts instance

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

Initialize echarts instance, use theme

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

Guess you like

Origin blog.csdn.net/weixin_44001906/article/details/125667921