perf: 统计分布: 图表的图例

feature/year-over-year
Lei OT 2 years ago
parent c9c7638cf8
commit 230670e43a

@ -11,6 +11,10 @@ const COLOR_SETS = [
"#E19348", "#E19348",
"#F383A2", "#F383A2",
]; ];
const COLOR_SETS2 = [
"#5B8FF9",
"#61DDAA",
"#65789B",];
/** /**
* 当期数据; 同比; 环比 * 当期数据; 同比; 环比
*/ */
@ -75,7 +79,58 @@ export default observer((props) => {
// return items; // return items;
// }, // },
}, },
legend: {position: 'top',layout: 'horizontal' }, legend: {
position: 'top',
layout: 'horizontal',
custom: true,
items: [
...['当期', '上期', '去年同期'].map((ele, ei) => ({
name: `${ele} 团数`,
value: `${ele} 团数`,
marker: {
symbol: 'square',
style: {
fill: COLOR_SETS2[ei],
r: 5,
},
},
})),
...['当期', '上期', '去年同期'].map((ele, ei) => ({
name: `${ele} 业绩`,
value: `${ele} 业绩`,
marker: {
symbol: 'hyphen',
style: {
stroke: COLOR_SETS2[ei],
r: 5,
lineWidth: 2
},
},
})),
...['环比', '同比'].map((ele, ei) => ({
name: `团数 ${ele}`,
value: `团数 ${ele}`,
marker: {
symbol: 'square',
style: {
fill: COLOR_SETS[ei],
r: 5,
},
},
})),
...['环比', '同比'].map((ele, ei) => ({
name: `业绩 ${ele}`,
value: `业绩 ${ele}`,
marker: {
symbol: 'square',
style: {
fill: COLOR_SETS[ei+2],
r: 5,
},
},
})),
],
},
plots: [ plots: [
{ {
type: 'column', type: 'column',
@ -91,7 +146,7 @@ export default observer((props) => {
}), }),
// color: '#b32b19', // color: '#b32b19',
// color: '#f58269', // color: '#f58269',
legend: {}, legend: false, // {},
smooth: true, smooth: true,
yAxis: { yAxis: {
type: 'linear', type: 'linear',
@ -118,7 +173,7 @@ export default observer((props) => {
yField: 'yField', yField: 'yField',
seriesField: 'yGroup', seriesField: 'yGroup',
xAxis: false, xAxis: false,
legend: {}, legend: false, // {},
meta: merge( meta: merge(
{ {
...cloneDeep(dataFieldAlias), ...cloneDeep(dataFieldAlias),
@ -175,7 +230,7 @@ export default observer((props) => {
max: 250, max: 250,
tickCount: 4, tickCount: 4,
}, },
legend: {}, legend: false, // {},
color: COLOR_SETS, color: COLOR_SETS,
annotations: diffLine, annotations: diffLine,
}, },

Loading…
Cancel
Save