|
@@ -339,45 +339,45 @@ export default {
|
|
|
}, [])
|
|
|
|
|
|
let series = mockData.result.reduce((p, c, i, array) => {
|
|
|
- p.push({
|
|
|
- z: i + 1,
|
|
|
- stack: '总量',
|
|
|
- type: 'bar',
|
|
|
- name: c.name,
|
|
|
- barGap: 18,
|
|
|
- barWidth: 18,
|
|
|
- data: c.data,
|
|
|
- itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[i] } },
|
|
|
- }, {
|
|
|
- z: i + 10,
|
|
|
- type: 'pictorialBar',
|
|
|
- symbolPosition: 'end',
|
|
|
- symbol: 'diamond',
|
|
|
- symbolOffset: [0, '-50%'],
|
|
|
- symbolSize: [18, 12],
|
|
|
- data: diamondData[i],
|
|
|
- itemStyle: { color: color2[i] },
|
|
|
- tooltip: { show: true },
|
|
|
- })
|
|
|
-
|
|
|
- // 是否最后一个了?
|
|
|
- if (p.length === (array.length) * 2) {
|
|
|
- p.push({
|
|
|
- z: array.length * 2,
|
|
|
- type: "pictorialBar",
|
|
|
- symbolPosition: "start",
|
|
|
- data: mockData.result[0].data,
|
|
|
- symbol: "diamond",
|
|
|
- symbolOffset: ["0%", "50%"],
|
|
|
- symbolSize: [18, 10],
|
|
|
- itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[0] } },
|
|
|
- tooltip: { show: true },
|
|
|
- })
|
|
|
- return p
|
|
|
- }
|
|
|
-
|
|
|
- return p
|
|
|
- }, [])
|
|
|
+ p.push({
|
|
|
+ z: i + 1,
|
|
|
+ stack: '总量',
|
|
|
+ type: 'bar',
|
|
|
+ name: c.name,
|
|
|
+ barGap: 18,
|
|
|
+ barWidth: 18,
|
|
|
+ data: c.data,
|
|
|
+ itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[i] } },
|
|
|
+ }, {
|
|
|
+ z: i + 10,
|
|
|
+ type: 'pictorialBar',
|
|
|
+ symbolPosition: 'end',
|
|
|
+ symbol: 'diamond',
|
|
|
+ symbolOffset: [0, '-50%'],
|
|
|
+ symbolSize: [18, 12],
|
|
|
+ data: diamondData[i],
|
|
|
+ itemStyle: { color: color2[i] },
|
|
|
+ tooltip: { show: false },
|
|
|
+ })
|
|
|
+
|
|
|
+ // 是否最后一个了?
|
|
|
+ if (p.length === (array.length) * 2) {
|
|
|
+ p.push({
|
|
|
+ z: array.length * 2,
|
|
|
+ type: "pictorialBar",
|
|
|
+ symbolPosition: "start",
|
|
|
+ data: mockData.result[0].data,
|
|
|
+ symbol: "diamond",
|
|
|
+ symbolOffset: ["0%", "50%"],
|
|
|
+ symbolSize: [18, 10],
|
|
|
+ itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[0] } },
|
|
|
+ tooltip: { show: false },
|
|
|
+ })
|
|
|
+ return p
|
|
|
+ }
|
|
|
+
|
|
|
+ return p
|
|
|
+ }, [])
|
|
|
|
|
|
const dataZoom = [{
|
|
|
show: false,
|
|
@@ -393,7 +393,7 @@ export default {
|
|
|
|
|
|
tooltip, legend, xAxis, yAxis, series, grid, dataZoom, backgroundColor: 'rgba(0, 0, 0, 0)'
|
|
|
}
|
|
|
-
|
|
|
+ console.log( series,' series')
|
|
|
|
|
|
myChart.setOption(option);
|
|
|
|
|
@@ -1266,7 +1266,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
#gy_jg_echart {
|
|
|
- z-index: -1;
|
|
|
+ //z-index: 1;
|
|
|
left: -2rem;
|
|
|
top: 0.1rem;
|
|
|
width: 30rem;
|