echarts - importar tema personalizado

Editar tema en el editor de temas - Apache ECharts

Descargue el tema (aquí está la versión JSON de ejemplo), copie el código en el archivo mytheme.js y mantenga el nombre del archivo consistente con el nombre del tema.

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

Importar archivo mytheme.js

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

Registre el tema antes de inicializar la instancia de echarts

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

Inicializa la instancia de echarts, usa el tema

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

Supongo que te gusta

Origin blog.csdn.net/weixin_44001906/article/details/125667921
Recomendado
Clasificación