Commit da31288b by limin

视觉优化

1 parent 44fcc282
...@@ -822,28 +822,34 @@ export default { ...@@ -822,28 +822,34 @@ export default {
// this.onMapBack(AMap,heatMapData) // this.onMapBack(AMap,heatMapData)
// }) // })
loadMap().then(AMap=>{ loadMap().then(AMap => {
var map = new AMap.Map('map',{ var map = new AMap.Map('map', {
resizeEnable: true, resizeEnable: true,
center:[103.048078,36.383814], center: [103.048078, 36.383814],
zoom: 3, zoom: 3,
mapStyle: "amap://styles/darkblue" mapStyle: 'amap://styles/darkblue',
zoomEnable: false,
dragEnable: false
}) })
var heatmap = new AMap.Heatmap(map, { var heatmap = new AMap.Heatmap(map, {
radius: 10, //给定半径 radius: 8, //给定半径
opacity: [0, 0.8] opacity: [0, 0.8]
}) })
request.req(devicesMethods.HeatMapIp).then(heatMapData=>{ request.req(devicesMethods.HeatMapIp).then(heatMapData => {
heatmap.setDataSet({ heatmap.setDataSet({
data: heatMapData, data: heatMapData,
max: 100 max: 100,
gradient: {
0.3: 'blue',
0.5: 'green',
0.7: 'yellow',
0.9: 'red'
}
}) })
}) })
}) })
}, },
onMapBack(AMap,heatMapData){ onMapBack(AMap, heatMapData) {},
},
onHeatMapDataBack(heatMapData) { onHeatMapDataBack(heatMapData) {
console.log(heatMapData) console.log(heatMapData)
}, },
...@@ -855,10 +861,14 @@ export default { ...@@ -855,10 +861,14 @@ export default {
} }
return day return day
})() })()
var yData = timeRangeData.map(item => item.sumLogin) var yData = timeRangeData
.sort((a, b) => a.hour - b.hour)
.map(item => item.sumLogin)
// var yData = timeRangeData
this.initRange(xData, yData) this.initRange(xData, yData)
}, },
onTrandDataBack(trandData) { onTrandDataBack(trandData) {
trandData.sort((a, b) => a.day - b.day)
var xData = [], var xData = [],
yData = [] yData = []
for (const item of trandData) { for (const item of trandData) {
...@@ -873,29 +883,30 @@ export default { ...@@ -873,29 +883,30 @@ export default {
rangeChart.setOption({ rangeChart.setOption({
backgroundColor: '#080b30', backgroundColor: '#080b30',
grid: { grid: {
top: '15%', top: '10%',
left: '5%', left: '6%',
right: '5%', right: '6%',
bottom: '15%' bottom: '5%',
// containLabel: true containLabel: true
}, },
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
axisLine: { axisLine: {
show: false,
lineStyle: { lineStyle: {
color: '#999' color: 'rgba(255, 129, 109,.1)',
width: 1 //这里是为了突出显示加上的
} }
}, },
splitArea: { axisTick: {
// show: true, show: false
},
axisLabel: {
textStyle: {
color: '#999', color: '#999',
lineStyle: { fontSize: 12
color: '#999'
} }
}, },
boundaryGap: false,
data: xData data: xData
} }
], ],
...@@ -906,20 +917,22 @@ export default { ...@@ -906,20 +917,22 @@ export default {
min: 0, min: 0,
// max: 140, // max: 140,
splitNumber: 4, splitNumber: 4,
splitLine: {
show: true,
lineStyle: {
color: 'rgba(255,255,255,0.1)'
}
},
axisLine: { axisLine: {
show: false, show: false
}, },
axisLabel: { axisLabel: {
show: false, show: false
}, },
axisTick: { axisTick: {
show: false show: false
},
splitLine: {
show: true,
lineStyle: {
color: 'rgba(255, 129, 109, 0.1)',
width: 0.2,
type: 'dashed'
}
} }
} }
], ],
...@@ -928,30 +941,30 @@ export default { ...@@ -928,30 +941,30 @@ export default {
type: 'line', type: 'line',
smooth: true, //是否平滑 smooth: true, //是否平滑
showAllSymbol: false, showAllSymbol: false,
// symbol: 'image://./static/images/guang-circle.png', symbol: 'none',
// symbol: 'circle', itemStyle: {
// symbolSize: 10,
areaStyle: {
normal: { normal: {
color: new echarts.graphic.LinearGradient( color: {
0, type: 'linear',
0, x: 0,
0, y: 0,
1, x2: 0,
[ y2: 1,
colorStops: [
{ {
offset: 0, offset: 0,
color: 'rgba(108,80,243,0.3)' color: 'red'
}, },
{ {
offset: 1, offset: 1,
color: 'rgba(108,80,243,0)' color: '#08DFFE'
} }
], ],
false global: false // 缺省为 false
), }
shadowColor: 'rgba(108,80,243, 0.9)', },
shadowBlur: 20 emphasis: {
opacity: 1
} }
}, },
data: yData data: yData
...@@ -964,10 +977,11 @@ export default { ...@@ -964,10 +977,11 @@ export default {
trendChart.setOption({ trendChart.setOption({
backgroundColor: '#080b30', backgroundColor: '#080b30',
grid: { grid: {
left: '12%', top: '10%',
top: '5%', left: '5%',
bottom: '12%', right: '5%',
right: '8%' bottom: '5%',
containLabel: true
}, },
xAxis: { xAxis: {
data: xData, data: xData,
...@@ -1029,6 +1043,29 @@ export default { ...@@ -1029,6 +1043,29 @@ export default {
fontSize: 12, fontSize: 12,
rotate: 45 rotate: 45
}, },
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: 'rgba(108,80,243,0.3)'
},
{
offset: 1,
color: 'rgba(108,80,243,0)'
}
],
false
),
shadowColor: 'rgba(108,80,243, 0.9)',
shadowBlur: 20
}
},
itemStyle: { itemStyle: {
normal: { normal: {
color: { color: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!