sgj
3 天以前 241d327e57cbfe504aa806c61aa22e6205706098
fzzy-igdss-web/src/main/resources/static/group/gis-chart.js
@@ -17,7 +17,7 @@
                return params.name + ': ' + params.value;
            }
        },
        color: ['#FF6B6B','#4ECDC4','#45B7D1','#96CEB4','#FECA57','#FF9FF3','#54A0FF','#5F27CD','#00D2D3','#FF7675','#208620'],
        color: ['#96CEB4','#4ECDC4','#45B7D1','#FF6B6B','#FECA57','#FF9FF3','#54A0FF','#5F27CD','#00D2D3','#FF7675','#208620'],
        series: [
            {
                name: '',
@@ -234,4 +234,157 @@
        ]
    };
    barChart.setOption(option);
}
}
function modelingBarChartLoad(id) {
    var dom = document.getElementById(id);
    var barChart = echarts.init(dom);
    var predata = [];
    var ydata = [];
    if (gisData) {
        predata[0] = gisData.bankSumPer;
        ydata[0] = gisData.bankSum;
    } else {
        predata = [50];
        ydata = [500];
    }
    var option = {
        grid: {
            top: '20%',
            left: '2%',
            right: '5%',
            bottom: '1%',
        },
        tooltip: {
            show: true,
            trigger: "axis",
            formatter: function (data) {
                let result = '';
                let content = '';
                for (let i = 0; i < data.length - 1; i++) {
                    if (data[i].componentSubType === 'bar' && data[i].seriesName !== '背景条') {
                        content += `${data[i].marker} ${data[i].seriesName}<span style='font-size:12px; float:right;margin-left:20px;'>${data[i].data}</span><br/>`
                        result = `<span style='font-size: 14px;'>${data[i].name}</span> <br/> ${content}`;
                    }
                }
                return result;
            }
        },
        xAxis: {
            splitLine: {
                show: false
            },
            axisLabel: {
                margin: 20,
                show: false
            },
            axisTick: {
                show: false
            },
            axisLine: {
                show: false
            }
        },
        yAxis: [{
            inverse: true,
            type: 'category',
            splitLine: {
                show: false
            },
            axisLine: {
                show: false
            },
            axisLabel: {
                align: 'left',
                verticalAlign: 'bottom',
                padding: [0, 0, 26, 10],
                fontSize: "18",
                color: '#fff',
                formatter: function (param) {
                    return ['{img|}' + '{b|' + param + '}']
                },
                rich: {
                    b: {
                        fontSize: 18,
                        color: '#fff',
                        padding: [0, 0, 0, 10]
                    },
                    img: {
                        backgroundColor: {
                            image: '/img/web/group/c-i1.png',
                        },
                        width: 17,
                        align: 'left',
                    }
                }
            },
            axisTick: {
                show: false
            },
            data: ['质押重量'],
        },
            {
                type: "category",
                inverse: true,
                axisTick: "none",
                axisLine: "none",
                show: true,
                axisLabel: {
                    inside: true,
                    verticalAlign: "bottom",
                    textStyle: {
                        fontFamily: 'DINCond-Bold',
                        color: "#ffd12b",
                        fontSize: "20",
                        padding: [0, 0, 26, 0],
                    },
                    formatter: function (param) {
                        return toThousands(param)
                    }
                },
                data: ydata,
            }
        ],
        series: [{
            name: '占比',
            type: 'bar',
            stack: 'all',
            barWidth: 12,
            itemStyle: {
                color: '#00e4fa'
            },
            data: predata,
            z: 1
        },
            {
                name: '辅助值',
                type: 'pictorialBar',
                barWidth: 12,
                symbol: 'roundRect',
                symbolMargin: 2,
                symbolSize: [2, 12],
                symbolOffset: [-2, '0%'],
                symbolClip: true,
                symbolRepeat: true,
                itemStyle: {
                    color: '#082640'
                },
                data: [100],
                z: 2
            },
            {
                name: '背景条',
                type: 'bar',
                silent: true,
                barWidth: 12,
                barGap: '-100%',
                itemStyle: {
                    color: '#082640'
                },
                data: [100],
                z: 0
            }
        ]
    };
    barChart.setOption(option);
}