/** * echart自定义主题 * Author: abner * Date: 2020-12-25 * 注意:主题的优先级比setOption低 */ let myTheme = { // 全图默认背景 // backgroundColor: 'rgba(0,0,0,0)', // 全图文字 "textStyle": { color: '#fff', fontFamily: 'Microsoft YaHei UI', fontSize: 12, }, // 默认色板 "color": ['#838CFF', '#2AE3FF', '#FA7332', '#D797FF', '#fa2c7b', '#ff38e0', '#ffa235', '#04c5f3', '#0066fe', '#8932a5', '#c90444', '#cb9bff', '#434348', '#90ed7d'], //标题 "title": { x: 'center', //位置默认居中 textStyle: { fontFamily: 'Microsoft YaHei UI', fontSize: 14, color: '#fff' // 主标题文字颜色 }, subtextStyle: { color: '#aaa' // 副标题文字颜色 } }, // @图例 "legend": { type: 'plain', //plain:普通图例 'scroll':可滚动翻页的图例。当图例数量较多时可以使用。 orient: 'horizontal', //垂直 vertical | 水平 horizontal left: 'left', //位置默认左 // bottom: '0', textStyle: { color: '#fff' // 图例文字颜色 } }, // @工具栏 此配置无法起效,必须在option中配置 // "toolbox": { // show: true, // 默认显示 // feature: { // dataZoom: { // yAxisIndex: 'none' // }, // dataView: { readOnly: false }, // magicType: { type: ['line', 'bar'] }, // restore: {}, // saveAsImage: {} // } // }, // @纵轴 "categoryAxis": { "axisLine": { "show": true, "lineStyle": { "color": "#008acd" } }, "axisTick": { // 刻度线 "show": true, "lineStyle": { "color": "#fff" } }, "axisLabel": { // 刻度值 "show": true, "textStyle": { "color": "#fff" } }, "splitLine": { // 坐标轴在 grid 区域中的分隔线。默认数值轴(横向)显示,类目轴(纵向)不显示。 "show": false, "lineStyle": { "color": [ "#eee" ] } }, "splitArea": { // 坐标轴在 grid 区域中的分隔区域,默认不显示。 "show": false, "areaStyle": { "color": [ "rgba(250,250,250,0.3)", "rgba(200,200,200,0.3)" ] } } }, // @横轴 "valueAxis": { "axisLine": { "show": true, "lineStyle": { "color": "#008acd" } }, "axisTick": { // 刻度线 "show": true, "lineStyle": { "color": "#fff" } }, "axisLabel": { // 刻度值 "show": true, "textStyle": { "color": "#fff" } }, "splitLine": { // 坐标轴在 grid 区域中的分隔线。默认数值轴(横向)显示,类目轴(纵向)不显示。 "show": true, "lineStyle": { // 分隔线的样式设置。 "color": [ "#ccc" ] } }, "splitArea": { // 坐标轴在 grid 区域中的分隔区域,默认不显示。 "show": false, "areaStyle": { // 分隔区域的样式设置。 "color": [ "rgba(250,250,250,0.3)", "rgba(200,200,200,0.3)" ] } } }, // @数据滑竿 "dataZoom": { "show": true, "backgroundColor": "rgba(47,69,84,0)", "dataBackgroundColor": "rgba(239,239,255,1)", "fillerColor": "rgba(182,162,222,0.2)", "handleColor": "#008acd", "handleSize": "100%", "textStyle": { "color": "#333333" } }, "markPoint": { "label": { "color": "#eeeeee" }, "emphasis": { "label": { "color": "#eeeeee" } } } }