自动化立体仓库 - WMS系统
zjj
2024-12-24 68b1f2c9d07385c094c348f15e1c4132c8d2cf97
src/main/webapp/views/home/console.html
@@ -122,21 +122,31 @@
            success:function(res){
                var data = res.data;
                var dataPie=eval(data.rows);
                var chart = {
                Highcharts.chart('pie', {
                    chart: {
                    plotBackgroundColor: null,
                    plotBorderWidth: null,
                    plotShadow: false
                };
                var title = {
                        plotShadow: false,
                        type: 'pie'
                    },
                    title: {
                    text: '库位使用比例',
                    margin:1,
                    style: {fontSize: '18px',color: '#777',fontWeight: 'bold'},
                    y: 5
                };
                var tooltip = {
                    },
                    credits:{
                        enabled:false
                    },
                    tooltip: {
                    pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
                };
                var plotOptions = {
                    },
                    legend:{
                        align:'center',
                        labelFormat:'{name}:{y}'
                    },
                    plotOptions: {
                    pie: {
                        allowPointSelect: true,
                        cursor: 'pointer',
@@ -146,30 +156,20 @@
                            style: {
                                color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                            }
                        }
                    }
                };
                var series= [{
                    type: 'pie',
                    name: '库位占比',
                    data: dataPie
                }];
                var loading = {
                    hideDuration: 3,
                    showDuration: 3
                };
                var json = {};
                json.chart = chart;
                json.title = title;
                json.tooltip = tooltip;
                json.series = series;
                json.plotOptions = plotOptions;
                json.loading = loading;
                json.credits = {enabled: false};
                $('#pie').highcharts(json);
                            },
                            showInLegend: true,
                        }
                    },
                    series: [{
                        name: '库位占比',
                        colorByPoint: true,
                        data: dataPie
                    }]
                });
            },
            error:function(){
                // 错误处理
            }
        });
    }