/* * @Author: changjun * @FilePath: /yuan-qingdao-zld-browser/src/components/chart/options/theme.ts * @Date: 2022-09-05 15:33:45 * @Description: * @LastEditTime: 2023-06-02 09:49:25 * @LastEditors: 曹文丽 */ /** * 自定义不同echart图形颜色 * themeColor = { * shangdong(区域): { * colorList: 10种颜色 * colorListAll: 20种颜色 * } * } */ export const themeColor = { base: { colorList: [ "rgba(28, 146, 208, 1)", "rgba(236, 119, 119, 1)", "rgba(121, 194, 192, 1)", "rgba(255, 180, 180, 1)", "rgba(151, 194, 121, 1)", "rgba(232, 193, 93, 1)", "rgba(135, 122, 219, 1)", "rgba(205, 122, 6, 1)", "rgba(170, 109, 196, 1)", "rgba(178, 141, 158, 1)", ], colorListAll: [ "rgba(28, 146, 208, 1)", "rgba(64, 192, 227, 1)", "rgba(93, 150, 181, 1)", "rgba(22, 109, 206, 1)", "rgba(121, 194, 192, 1)", "rgba(52, 176, 138, 1)", "rgba(151, 194, 121, 1)", "rgba(142, 187, 234, 1)", "rgba(135, 122, 219, 1)", "rgba(181, 155, 229, 1)", "rgba(170, 109, 196, 1)", "rgba(232, 103, 163, 1)", "rgba(236, 119, 119, 1)", "rgba(255, 180, 180, 1)", "rgba(232, 193, 93, 1)", "rgba(169, 153, 121, 1)", "rgba(205, 122, 6, 1)", "rgba(132, 90, 32, 1)", "rgba(178, 141, 158, 1)", ], LinearGradient: [ ["#764D90", "#484FBD"], ["#35399A", "#4C5BCE"], ["#4E8A6E", "#46B36B"], ["#2128BD", "#3869F9"], ], // 渐变色 progressColor: "rgba(28, 146, 208, 1)", // 进度条 LinearGradientColor: "110, 200, 236", funnelColorList: [ "rgba(28, 146, 208, 1)", "rgba(28, 146, 208, .9)", "rgba(28, 146, 208, .8)", "rgba(28, 146, 208, .7)", "rgba(28, 146, 208, .6)", "rgba(28, 146, 208, .5)", "rgba(28, 146, 208, .4)", "rgba(28, 146, 208, .3)", "rgba(28, 146, 208, .2)", "rgba(28, 146, 208, .1)", ], // 漏斗图 }, }; // 根据部署地区code获取颜色主题 export const getThemeColor = () => { return themeColor["base"] || {}; }; // 折线图颜色默认定义 export const lineChartThemeColor = { light: { legendTextColor: "rgba(0,0,0,0.4000)", axisLabelColor: "rgba(0,0,0,0.4000)", axisLineColor: "rgba(0,0,0,0.05)", titleColor: "rgba(0,0,0,0.4000)", colorList: getThemeColor().colorList || [ "#1C92D0", "#F1BC01", "#FF85EE", "#259F2F", "#FF2F2F", "#677DFF", "#9E7AFE", "#F7C424", "#F481FF", "#DB00BC", ], }, dark: { legendTextColor: "rgba(255,255,255,0.4000)", axisLabelColor: "rgba(255,255,255,0.4000)", axisLineColor: "rgba(159, 159, 159, .3)", titleColor: "rgba(255,255,255,0.4000)", colorList: getThemeColor().colorList || [ "rgba(114, 197, 255, 1)", "rgba(233, 136, 136, 1)", "rgba(255, 194, 137, 1)", "rgba(15, 215, 170, 1)", "rgba(125, 241, 255, 1)", "rgba(217, 223, 255, 1)", "rgba(229, 219, 255, 1)", "rgba(255, 241, 195, 1)", "rgba(250, 199, 255, 1)", ], }, }; // 柱状图图颜色默认定义 export const barChartThemeColor = { light: { legendTextColor: "rgba(0,0,0,0.4000)", axisLabelColor: "rgba(0,0,0,0.4000)", axisLineColor: "rgba(0,0,0,0.05)", titleColor: "rgba(0,0,0,0.4000)", colorList: getThemeColor().colorList || [ "#0095FF", "#FE7F09", "#E65857", "#4E9B40", "#45BCCA", "#677DFF", "#9E7AFE", "#F7C424", "#F481FF", "#DB00BC", ], }, dark: { legendTextColor: "rgba(255,255,255,0.4)", axisLabelColor: "rgba(255,255,255,0.5)", axisLineColor: "rgba(159, 159, 159, .3)", titleColor: "rgba(255,255,255,0.4000)", colorList: [ "rgba(127, 148, 198, 1)", "rgba(170, 183, 204, 1)", "rgba(155, 155, 177, 1)", "rgba(141, 128, 152, 1)", "rgba(125, 101, 127, 1)", "rgba(143, 115, 111, 1)", "rgba(139, 104, 99, 1)", "rgba(142, 105, 62, 1)", "rgba(146, 99, 99, 1)", "rgba(152, 128, 146, 1)", "rgba(151, 146, 113, 1)", "rgba(158, 157, 110, 1)", ], }, }; // echart通用主题色 export const chartCommonThemeColor = { light: { colorList: getThemeColor().colorList || [ "#0095FF", "#E65857", "#FE7F09", "#4E9B40", "#45BCCA", "#677DFF", "#9E7AFE", "#F7C424", "#F481FF", "#DB00BC", ], tooltip: { backgroundColor: "rgba(255,255,255,0.96)", textStyle: { color: "rgba(0, 0, 0, 0.6500)", }, }, }, dark: { colorList: getThemeColor().colorList || [ "#2B4BAA", "#52986B", "#A68F58", "#A83D61", "#378CBD", "#198A7A", "#AB5148", "#633E9A", "#CF9268", "#009ADD", ], tooltip: { backgroundColor: "rgba(42,61,85,0.8)", textStyle: { color: "rgba(255, 255, 255, 0.6)", }, }, }, }; export const roseChartThemeColor = { light: { rich: { name: "rgba(0,0,0,0.65)", value: "rgba(0,0,0,0.4)", percent: "rgba(0,0,0,0.4)", }, emptyCircleStyle: { color: "rgba(0,0,0,0.4)", }, }, dark: { rich: { name: "rgba(255, 255, 255, .6)", value: "rgba(255, 255, 255, .4)", percent: "rgba(255, 255, 255, .4)", }, emptyCircleStyle: { color: "rgba(255, 255, 255, .4)", }, }, dark1: { rich: { name: "rgba(255, 255, 255, 1)", value: "rgba(255, 255, 255, .4)", percent: "rgba(255, 255, 255, .4)", }, emptyCircleStyle: { color: "rgba(255, 255, 255, .4)", }, }, }; export const getLineChartThemeColor = (theme) => { return lineChartThemeColor[theme]; }; export const getBarChartThemeColor = (theme) => { return barChartThemeColor[theme]; }; export const getRoseChartThemeColor = (theme) => { return roseChartThemeColor[theme]; }; export const getCommonTheme = (theme) => { return chartCommonThemeColor[theme]; };