|
@@ -18,14 +18,14 @@
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.myEcharts1();
|
|
|
- this.myEcharts2();
|
|
|
+ // this.myEcharts1();
|
|
|
+ // this.myEcharts2();
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
// 出处 http://192.144.199.210:8080/editor/index.html?chart_id=gK9VdA5_F06NTrpr
|
|
|
- myEcharts1() {
|
|
|
+ myEcharts1(seriesData) {
|
|
|
var chartDom = document.getElementById('detector1');
|
|
|
var myChart = echarts.init(chartDom);
|
|
|
var option;
|
|
@@ -34,7 +34,7 @@
|
|
|
trigger: 'item',
|
|
|
},
|
|
|
color: ['#f7c778', '#d77169', '#c14f60', '#4d9564', '#215b85', ],
|
|
|
-
|
|
|
+
|
|
|
series : [
|
|
|
{
|
|
|
name:'探测器分布',
|
|
@@ -51,13 +51,8 @@
|
|
|
maxSize: '100%',
|
|
|
sort : 'descending', // 'ascending', 'descending'
|
|
|
gap :0,
|
|
|
- data:[
|
|
|
- {value:60, name:'双辽市'},
|
|
|
- {value:40, name:'梨树县'},
|
|
|
- {value:20, name:'伊通县'},
|
|
|
- {value:80, name:'铁东区'},
|
|
|
- {value:100, name:'铁西区'}
|
|
|
- ].sort(function (a, b) { return a.value - b.value}),
|
|
|
+ data:seriesData.sort(function (a, b) {
|
|
|
+ return a.value - b.value}),
|
|
|
roseType: true,
|
|
|
label: {
|
|
|
normal: {
|
|
@@ -69,7 +64,7 @@
|
|
|
fontSize:'20px',
|
|
|
color:'#ffffff',
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -82,26 +77,26 @@
|
|
|
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
]
|
|
|
};
|
|
|
option && myChart.setOption(option);
|
|
|
},
|
|
|
|
|
|
// 出处 http://192.144.199.210:8080/editor/index.html?chart_id=APfCRAFKxpN_qWeq
|
|
|
- myEcharts2() {
|
|
|
+ myEcharts2(xdataName,contractnum) {
|
|
|
var chartDom = document.getElementById('detector2');
|
|
|
var myChart = echarts.init(chartDom);
|
|
|
var option;
|
|
|
const dfColor = ['#92E1FF', '#0097FB', '#30ECA6', '#FFC227', '#FF4848'];
|
|
|
let dataArray = {
|
|
|
- xdataName: ['类型1', '类型1', '类型3', '类型3', '类型4', '类型5', '类型6'],
|
|
|
- contractnum: [9999, 8888, 7777, 6666, 5555, 4444, 3333]
|
|
|
+ xdataName: xdataName,
|
|
|
+ contractnum: contractnum
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
let color2 = [
|
|
|
[{ offset: 0, color: '#ff8881' }, { offset: 0.15, color: '#ff564c' },{ offset: 1, color: 'rgba(255,86,76, 0.08)' }],
|
|
|
[{ offset: 0, color: '#fff9e1' }, { offset: 0.15, color: '#ffe376' },{ offset: 1, color: 'rgba(255,209,26, 0.08)' }],
|
|
@@ -122,10 +117,10 @@
|
|
|
`
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// grid
|
|
|
let grid = { top: '20%', left: '10%', right: '10%', bottom: '20%' }
|
|
|
-
|
|
|
+
|
|
|
// xAxis
|
|
|
let xAxis = {
|
|
|
type: 'category',
|
|
@@ -138,12 +133,12 @@
|
|
|
},
|
|
|
axisTick: { show: false }, //坐标轴刻度
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// yAxis
|
|
|
let yAxis = {
|
|
|
show: false
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// series
|
|
|
let series = [{
|
|
|
name: '中高风险地区',
|
|
@@ -156,43 +151,43 @@
|
|
|
data: dataArray.contractnum,
|
|
|
itemStyle: {
|
|
|
color: params => {
|
|
|
- return params.name === dataArray.xdataName[0]
|
|
|
- ? new echarts.graphic.LinearGradient(0, 0, 0, 1, color2[0])
|
|
|
- : params.name === dataArray.xdataName[1]
|
|
|
- ? new echarts.graphic.LinearGradient(0, 0, 0, 1, color2[1])
|
|
|
+ return params.name === dataArray.xdataName[0]
|
|
|
+ ? new echarts.graphic.LinearGradient(0, 0, 0, 1, color2[0])
|
|
|
+ : params.name === dataArray.xdataName[1]
|
|
|
+ ? new echarts.graphic.LinearGradient(0, 0, 0, 1, color2[1])
|
|
|
: params.name === dataArray.xdataName[2]
|
|
|
- ? new echarts.graphic.LinearGradient(0, 0, 0, 1, color2[2])
|
|
|
- : new echarts.graphic.LinearGradient(0, 0, 0, 1, color2[3])
|
|
|
- }
|
|
|
+ ? new echarts.graphic.LinearGradient(0, 0, 0, 1, color2[2])
|
|
|
+ : new echarts.graphic.LinearGradient(0, 0, 0, 1, color2[3])
|
|
|
+ }
|
|
|
},
|
|
|
label: {
|
|
|
show: true,
|
|
|
position: 'top',
|
|
|
- formatter: params => {
|
|
|
- return params.name === dataArray.xdataName[0]
|
|
|
- ? `{a|${params.value}}`
|
|
|
- : params.name === dataArray.xdataName[1]
|
|
|
- ? `{b|${params.value}}`
|
|
|
+ formatter: params => {
|
|
|
+ return params.name === dataArray.xdataName[0]
|
|
|
+ ? `{a|${params.value}}`
|
|
|
+ : params.name === dataArray.xdataName[1]
|
|
|
+ ? `{b|${params.value}}`
|
|
|
: params.name === dataArray.xdataName[2]
|
|
|
- ? `{c|${params.value}}`
|
|
|
- : `{d|${params.value}}`
|
|
|
+ ? `{c|${params.value}}`
|
|
|
+ : `{d|${params.value}}`
|
|
|
},
|
|
|
rich: {
|
|
|
a: { color: '#ff564c' },
|
|
|
b: { color: '#ffd11a' },
|
|
|
c: { color: '#efff37' },
|
|
|
d: { color: '#32ffee' },
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
textStyle: { fontSize: 16 }
|
|
|
},
|
|
|
}]
|
|
|
-
|
|
|
+
|
|
|
// 渲染
|
|
|
option = { tooltip, grid, xAxis, yAxis, series }
|
|
|
option && myChart.setOption(option);
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
},
|