app/zh/index.html [16:535]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
“主题”是 ECharts 图表的风格抽象,用于统一多个图表的风格样式。使用主题在线构建工具,可以快速直观地生成主题配置文件,并在 ECharts 中使用自定义的主题样式。
在此主题的基础上,你仍然可以使用 setOption 覆盖或设置主题样式。
setOption
ECharts 官方提供 default、infographic、shine、roma、macarons、vintage 等主题,可供下载使用。
default
infographic
shine
roma
macarons
vintage
为了便于二次修改,我们的主题构建工具支持导入、导出配置项,导出的 JSON 文件仅用于在本工具中导入使用,而不能直接作为主题在 ECharts 中注册。
*.js
echarts.init(dom, '{{ themeName || 'customized' }}')
*.json
obj = JSON.parse(data)
echarts.registerTheme('{{ themeName || 'customized' }}', obj)