diff --git a/src/assets/scss/modules/visual/shijianchulifenxi.scss b/src/assets/scss/modules/visual/shijianchulifenxi.scss
index 01f5d738..ca099bed 100644
--- a/src/assets/scss/modules/visual/shijianchulifenxi.scss
+++ b/src/assets/scss/modules/visual/shijianchulifenxi.scss
@@ -21,8 +21,8 @@
}
.l_bottom {
- height: calc(100vh - 200px - 355px);
- margin-top: 20px;
+ height: calc(100vh - 200px - 365px);
+ margin-top: 0;
}
}
diff --git a/src/views/modules/visual/communityGovern/shijianchuli/chart.js b/src/views/modules/visual/communityGovern/shijianchuli/chart.js
index 8d19ca2d..f7c5dda5 100644
--- a/src/views/modules/visual/communityGovern/shijianchuli/chart.js
+++ b/src/views/modules/visual/communityGovern/shijianchuli/chart.js
@@ -120,21 +120,22 @@
fontSize: 13
},
formatter: params => {
- if (
- params.seriesName !== 'mouseoutSeries' &&
- params.seriesName !== 'pie2d'
- ) {
- const bfb = (
- (option.series[params.seriesIndex].pieData.endRatio -
- option.series[params.seriesIndex].pieData.startRatio) *
- 100
- ).toFixed(2)
- return (
- `${params.seriesName}
` +
- `` +
- `${bfb}%`
- )
- }
+
+ // if (
+ // params.seriesName !== 'mouseoutSeries' &&
+ // params.seriesName !== 'pie2d'
+ // ) {
+ // const bfb = (
+ // (option.series[params.seriesIndex].pieData.endRatio -
+ // option.series[params.seriesIndex].pieData.startRatio) *
+ // 100
+ // ).toFixed(2)
+ // return (
+ // `${params.seriesName}
` +
+ // `` +
+ // `${bfb}%`
+ // )
+ // }
}
},
xAxis3D: {
diff --git a/src/views/modules/visual/communityGovern/shijianchuli/lineOption.js b/src/views/modules/visual/communityGovern/shijianchuli/lineOption.js
index 04b4f950..d02e4b20 100644
--- a/src/views/modules/visual/communityGovern/shijianchuli/lineOption.js
+++ b/src/views/modules/visual/communityGovern/shijianchuli/lineOption.js
@@ -1,4 +1,11 @@
import * as echarts from 'echarts'
+let circleList = [
+ 'image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAhCAYAAA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PZv3hCyvT+vp2B1TVMaJsij0K0HgMwIBIAKMCYBmjLZVSinqlWI9Z0XHmNSGH09B/8BeBvq897QcAAxCzIZVzWtrWPLAAOhFIbaMm7qMgaimrHKPNEdeV1eEE3HHAGtC1RRDH6D+vsRAQHgG8VRQOMqY0tUcOHIsAbOjJG0rX9XeeBIZ9iEULUUFVtPNe2kTqkJkLgDOlckHm8kqtYVlvYoQMDImKrfPeJyNIuluDJOmrUxSttk23LRAjcEckdErSQUM/Rlg0or45bqowDtWkMhLy2pw+lfOvKBsryEpbUIV7a45irC/GJOM2AYB+MoFakE/TlMla8L1CmQxypFk4MuZNVVOn+J6+Z45xuWMNoG09o3yTkGMnjOTJ3AYvn252xj9NoH09lHQtiCVdyVdwifScYYYjIynqmxRSEjwKNcUxdbKkXhjGVqoYqlXMTu4BnO88LqbZwiC10RQmeuI5ZUUAJecvCGIqOEag3OKMgEefM21F6F5hh72xkr2eJozPLD1AAQc9NELIup9x4VkOCu5ZN3A3dC+6MGZt2W06Pd92G3QITY9r1PEHTe/43wHWzfk8OAP8D28XBfaJJ48oAAAAASUVORK5CYII='
+]
+let className = ['1号停车场', '2号停车场', '3号停车场', '4号停车场', '5号停车场', '6号停车场', '7号停车场']
+let serviceCount = [50, 28, 17, 38, 90, 73, 39]
+
export function lineOption () {
return {
@@ -11,6 +18,13 @@ export function lineOption () {
}
}
},
+ // grid: {
+ // left: '5%',
+ // right: '5%',
+ // bottom: '5%',
+ // top: '10%',
+ // containLabel: true
+ // },
xAxis: {
type: 'category',
// boundaryGap: false,
@@ -25,7 +39,8 @@ export function lineOption () {
lineStyle: {
color: '#0c4b59'
}
- }
+ },
+ // data: className
},
yAxis: {
nameTextStyle: {
@@ -58,29 +73,82 @@ export function lineOption () {
}
}
},
+ // series: [
+ // {
+ // name: '项目数',
+ // type: 'line',
+ // smooth: true,
+ // barWidth: 15,
+ // areaStyle: {},
+ // itemStyle: {
+ // color: new echarts.graphic.LinearGradient(
+ // 0, 1, 0, 0,
+ // [
+ // { offset: 0, color: 'rgba(121, 55, 255, 0)' },
+ // { offset: 1, color: '#6339FF' }
+ // ]
+ // )
+ // }
+ // },
+ // // {
+ // // data: [820, 932, 901, 934, 1290, 1330, 1320],
+ // // type: 'line',
+ // // areaStyle: {}
+ // // }
+ // ]
series: [
{
- name: '项目数',
- type: 'line',
- smooth: true,
- barWidth: 15,
- areaStyle: {},
- itemStyle: {
- color: new echarts.graphic.LinearGradient(
- 0, 1, 0, 0,
- [
- { offset: 0, color: 'rgba(121, 55, 255, 0)' },
- { offset: 1, color: '#6339FF' }
- ]
- )
- }
+ name: '',
+ type: 'bar',
+ zlevel: 1,
+ itemStyle: {
+
+ normal: {
+ barBorderRadius: 0,
+ color: function (params) {
+ // 大于等于50%的是黄色 反之为蓝色
+ var colorList = [
+ ['rgba(252, 210, 152, .2)', 'rgba(252, 210, 152, 1)'],
+ ['rgba(36, 253, 231, .2)', 'rgba(36, 253, 231, 1)'],
+ ];
+ var colorItem
+
+ colorItem = colorList[1];
+
+ // 设置线条渐变色
+ return new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
+ offset: 0,
+ color: colorItem[0]
+ },
+ {
+ offset: 1,
+ color: colorItem[1]
+ }
+ ], false);
+ }
+
+ },
+ },
+ barWidth: 4,
+ // data: serviceCount
+ },
+
+ {
+ name: 'XXX',
+ type: 'pictorialBar',
+ symbol: function (params, value) {
+ // 设置图片
+
+ return circleList[1]
},
- // {
- // data: [820, 932, 901, 934, 1290, 1330, 1320],
- // type: 'line',
- // areaStyle: {}
- // }
+ symbolPosition: 'end',
+ symbolSize: [30, 30],
+ symbolOffset: [0, -12],
+ z: 20,
+ // data: serviceCount
+ }
]
+
}
}
diff --git a/src/views/modules/visual/communityGovern/shijianchuli/shijianchulifenxi.vue b/src/views/modules/visual/communityGovern/shijianchuli/shijianchulifenxi.vue
index 44c35ded..c3a5c819 100644
--- a/src/views/modules/visual/communityGovern/shijianchuli/shijianchulifenxi.vue
+++ b/src/views/modules/visual/communityGovern/shijianchuli/shijianchulifenxi.vue
@@ -590,6 +590,7 @@ export default {
xAxis: { data: this.lineXaxis },
series: [
{ data: this.lineSeriesData },
+ { data: this.lineSeriesData },
]
}, true)
@@ -792,6 +793,7 @@ export default {
let hoveredIndex = ''
// 监听点击事件,实现选中效果(单选)
myChart.on('click', (params) => {
+ debugger
// 从 option.series 中读取重新渲染扇形所需的参数,将是否选中取反。
const isSelected = !this[optionName].series[params.seriesIndex].pieStatus
.selected
@@ -834,107 +836,107 @@ export default {
myChart.setOption(this[optionName])
})
// 监听 mouseover,近似实现高亮(放大)效果
- // myChart.on('mouseover', (params) => {
- // // 准备重新渲染扇形所需的参数
- // let isSelected
- // let isHovered
- // let startRatio
- // let endRatio
- // let k
- // // 如果触发 mouseover 的扇形当前已高亮,则不做操作
- // if (hoveredIndex === params.seriesIndex) {
- // // 否则进行高亮及必要的取消高亮操作
- // } else {
- // // 如果当前有高亮的扇形,取消其高亮状态(对 option 更新)
- // if (hoveredIndex !== '') {
- // // 从 option.series 中读取重新渲染扇形所需的参数,将是否高亮设置为 false。
- // isSelected = this[optionName].series[hoveredIndex].pieStatus.selected
- // isHovered = false
- // startRatio = this[optionName].series[hoveredIndex].pieData.startRatio
- // endRatio = this[optionName].series[hoveredIndex].pieData.endRatio
- // k = this[optionName].series[hoveredIndex].pieStatus.k
- // // 对当前点击的扇形,执行取消高亮操作(对 option 更新)
- // this[optionName].series[
- // hoveredIndex
- // ].parametricEquation = getParametricEquation(
- // startRatio,
- // endRatio,
- // isSelected,
- // isHovered,
- // k,
- // this[optionName].series[hoveredIndex].pieData.value
- // )
- // this[optionName].series[hoveredIndex].pieStatus.hovered = isHovered
- // // 将此前记录的上次选中的扇形对应的系列号 seriesIndex 清空
- // hoveredIndex = ''
- // }
- // // 如果触发 mouseover 的扇形不是透明圆环,将其高亮(对 option 更新)
- // if (
- // params.seriesName !== 'mouseoutSeries' &&
- // params.seriesName !== 'pie2d'
- // ) {
- // // 从 option.series 中读取重新渲染扇形所需的参数,将是否高亮设置为 true。
- // isSelected =
- // this[optionName].series[params.seriesIndex].pieStatus.selected
- // isHovered = true
- // startRatio =
- // this[optionName].series[params.seriesIndex].pieData.startRatio
- // endRatio = this[optionName].series[params.seriesIndex].pieData.endRatio
- // k = this[optionName].series[params.seriesIndex].pieStatus.k
- // // 对当前点击的扇形,执行高亮操作(对 option 更新)
- // this[optionName].series[
- // params.seriesIndex
- // ].parametricEquation = getParametricEquation(
- // startRatio,
- // endRatio,
- // isSelected,
- // isHovered,
- // k,
- // this[optionName].series[params.seriesIndex].pieData.value + 60
- // )
- // this[optionName].series[
- // params.seriesIndex
- // ].pieStatus.hovered = isHovered
- // // 记录上次高亮的扇形对应的系列号 seriesIndex
- // hoveredIndex = params.seriesIndex
- // }
- // // 使用更新后的 option,渲染图表
- // myChart.setOption(this[optionName])
- // }
- // })
- // // 修正取消高亮失败的 bug
- // myChart.on('globalout', () => {
- // // 准备重新渲染扇形所需的参数
- // let isSelected
- // let isHovered
- // let startRatio
- // let endRatio
- // let k
- // if (hoveredIndex !== '') {
- // // 从 option.series 中读取重新渲染扇形所需的参数,将是否高亮设置为 true。
- // isSelected = this[optionName].series[hoveredIndex].pieStatus.selected
- // isHovered = false
- // k = this[optionName].series[hoveredIndex].pieStatus.k
- // startRatio = this[optionName].series[hoveredIndex].pieData.startRatio
- // endRatio = this[optionName].series[hoveredIndex].pieData.endRatio
- // // 对当前点击的扇形,执行取消高亮操作(对 option 更新)
- // this[optionName].series[
- // hoveredIndex
- // ].parametricEquation = getParametricEquation(
- // startRatio,
- // endRatio,
- // isSelected,
- // isHovered,
- // k,
- // this[optionName].series[hoveredIndex].pieData.value
- // )
- // this[optionName].series[hoveredIndex].pieStatus.hovered = isHovered
- // // 将此前记录的上次选中的扇形对应的系列号 seriesIndex 清空
- // hoveredIndex = ''
- // }
- // // 使用更新后的 option,渲染图表
- // myChart.setOption(this[optionName])
- // })
+ myChart.on('mouseover', (params) => {
+ // 准备重新渲染扇形所需的参数
+ let isSelected
+ let isHovered
+ let startRatio
+ let endRatio
+ let k
+ // 如果触发 mouseover 的扇形当前已高亮,则不做操作
+ if (hoveredIndex === params.seriesIndex) {
+ // 否则进行高亮及必要的取消高亮操作
+ } else {
+ // 如果当前有高亮的扇形,取消其高亮状态(对 option 更新)
+ if (hoveredIndex !== '') {
+ // 从 option.series 中读取重新渲染扇形所需的参数,将是否高亮设置为 false。
+ isSelected = this[optionName].series[hoveredIndex].pieStatus.selected
+ isHovered = false
+ startRatio = this[optionName].series[hoveredIndex].pieData.startRatio
+ endRatio = this[optionName].series[hoveredIndex].pieData.endRatio
+ k = this[optionName].series[hoveredIndex].pieStatus.k
+ // 对当前点击的扇形,执行取消高亮操作(对 option 更新)
+ this[optionName].series[
+ hoveredIndex
+ ].parametricEquation = getParametricEquation(
+ startRatio,
+ endRatio,
+ isSelected,
+ isHovered,
+ k,
+ this[optionName].series[hoveredIndex].pieData.value
+ )
+ this[optionName].series[hoveredIndex].pieStatus.hovered = isHovered
+ // 将此前记录的上次选中的扇形对应的系列号 seriesIndex 清空
+ hoveredIndex = ''
+ }
+ // 如果触发 mouseover 的扇形不是透明圆环,将其高亮(对 option 更新)
+ if (
+ params.seriesName !== 'mouseoutSeries' &&
+ params.seriesName !== 'pie2d'
+ ) {
+ // 从 option.series 中读取重新渲染扇形所需的参数,将是否高亮设置为 true。
+ isSelected =
+ this[optionName].series[params.seriesIndex].pieStatus.selected
+ isHovered = true
+ startRatio =
+ this[optionName].series[params.seriesIndex].pieData.startRatio
+ endRatio = this[optionName].series[params.seriesIndex].pieData.endRatio
+ k = this[optionName].series[params.seriesIndex].pieStatus.k
+ // 对当前点击的扇形,执行高亮操作(对 option 更新)
+ this[optionName].series[
+ params.seriesIndex
+ ].parametricEquation = getParametricEquation(
+ startRatio,
+ endRatio,
+ isSelected,
+ isHovered,
+ k,
+ this[optionName].series[params.seriesIndex].pieData.value + 60
+ )
+ this[optionName].series[
+ params.seriesIndex
+ ].pieStatus.hovered = isHovered
+ // 记录上次高亮的扇形对应的系列号 seriesIndex
+ hoveredIndex = params.seriesIndex
+ }
+ // 使用更新后的 option,渲染图表
+ myChart.setOption(this[optionName])
+ }
+ })
+ // 修正取消高亮失败的 bug
+ myChart.on('globalout', () => {
+ // 准备重新渲染扇形所需的参数
+ let isSelected
+ let isHovered
+ let startRatio
+ let endRatio
+ let k
+ if (hoveredIndex !== '') {
+ // 从 option.series 中读取重新渲染扇形所需的参数,将是否高亮设置为 true。
+ isSelected = this[optionName].series[hoveredIndex].pieStatus.selected
+ isHovered = false
+ k = this[optionName].series[hoveredIndex].pieStatus.k
+ startRatio = this[optionName].series[hoveredIndex].pieData.startRatio
+ endRatio = this[optionName].series[hoveredIndex].pieData.endRatio
+ // 对当前点击的扇形,执行取消高亮操作(对 option 更新)
+ this[optionName].series[
+ hoveredIndex
+ ].parametricEquation = getParametricEquation(
+ startRatio,
+ endRatio,
+ isSelected,
+ isHovered,
+ k,
+ this[optionName].series[hoveredIndex].pieData.value
+ )
+ this[optionName].series[hoveredIndex].pieStatus.hovered = isHovered
+ // 将此前记录的上次选中的扇形对应的系列号 seriesIndex 清空
+ hoveredIndex = ''
+ }
+ // 使用更新后的 option,渲染图表
+ myChart.setOption(this[optionName])
+ })
},