diff --git a/src/components/MixYnQ.jsx b/src/components/MixYnQ.jsx index 953d8a0..1a24c28 100644 --- a/src/components/MixYnQ.jsx +++ b/src/components/MixYnQ.jsx @@ -11,6 +11,10 @@ const COLOR_SETS = [ "#E19348", "#F383A2", ]; +const COLOR_SETS2 = [ + "#5B8FF9", + "#61DDAA", + "#65789B",]; /** * 当期数据; 同比; 环比 */ @@ -75,7 +79,58 @@ export default observer((props) => { // 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: [ { type: 'column', @@ -91,7 +146,7 @@ export default observer((props) => { }), // color: '#b32b19', // color: '#f58269', - legend: {}, + legend: false, // {}, smooth: true, yAxis: { type: 'linear', @@ -118,7 +173,7 @@ export default observer((props) => { yField: 'yField', seriesField: 'yGroup', xAxis: false, - legend: {}, + legend: false, // {}, meta: merge( { ...cloneDeep(dataFieldAlias), @@ -175,7 +230,7 @@ export default observer((props) => { max: 250, tickCount: 4, }, - legend: {}, + legend: false, // {}, color: COLOR_SETS, annotations: diffLine, },