perf: 调整overview饼图柱状图的颜色

This commit is contained in:
chenjinsong
2020-09-11 18:59:42 +08:00
parent 419eb09010
commit 4d0c8ec7f1
2 changed files with 6 additions and 15 deletions

View File

@@ -23,7 +23,7 @@
"#8abafc","#d181e8","#d88d50","#cce8ff", "#8abafc","#d181e8","#d88d50","#cce8ff",
"#161ef9"];*/ "#161ef9"];*/
let pieColor = ["#ECCD82", "#99CEB9", "#EEA694", "#8EA8DF", "#92C9DF"];/*['#d64f40', '#e66f60', '#f68f80', '#f6afa0', let pieColor = ["#FAd4ab", "#d0e8d0", "#EEA694", "#9fb5e4", "#92C9DF"];/*['#d64f40', '#e66f60', '#f68f80', '#f6afa0',
'#ffdb28', '#ffeb38', '#fffb48', '#ffffbb'];*/ '#ffdb28', '#ffeb38', '#fffb48', '#ffffbb'];*/
const commonOption={ const commonOption={
@@ -201,7 +201,7 @@
}, },
grid: { grid: {
top: 60, top: 60,
left: 80, left: 100,
right: 30, right: 30,
bottom: 60, bottom: 60,
}, },
@@ -237,8 +237,8 @@
show: true, show: true,
fontSize: 12, fontSize: 12,
formatter: function(value) { formatter: function(value) {
if (value.length > 10) { if (value.length > 15) {
return value.substring(0, 8) + "..."; return value.substring(0, 11) + "...";
} }
return value; return value;
}, },
@@ -250,15 +250,6 @@
title: { title: {
show: false, show: false,
}, },
color: function(params) {
//首先定义一个数组
let colorList = [pieColor[0], pieColor[1]];;
if(params.dataIndex % 2 == 0){
return colorList[0]
}else{
return colorList[1]
}
},
legend: { legend: {
show: false, show: false,
}, },

View File

@@ -782,7 +782,7 @@
barMaxWidth: 15, barMaxWidth: 15,
itemStyle: { itemStyle: {
color: function(params) { color: function(params) {
let colorList = ["#ECCD82", "#99CEB9"];; let colorList = ["#FAd4ab", "#d0e8d0"];
if(params.dataIndex % 2 == 0){ if(params.dataIndex % 2 == 0){
return colorList[0] return colorList[0]
}else{ }else{
@@ -816,7 +816,7 @@
category: categoryData, category: categoryData,
itemStyle: { itemStyle: {
color: function(params) { color: function(params) {
let colorList = ["#ECCD82", "#99CEB9"];; let colorList = ["#FAd4ab", "#d0e8d0"];;
if(params.dataIndex % 2 == 0){ if(params.dataIndex % 2 == 0){
return colorList[0] return colorList[0]
}else{ }else{