longyvfengyun
2022-05-19 30c7f2729ddf5612fe36d97789f50f464d4436e8
后台提交
1个文件已修改
120 ■■■■ 已修改文件
WebRoot/js/charge.js 120 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebRoot/js/charge.js
@@ -184,14 +184,64 @@
// 绘制左上折线图
var myLineChartTop;            //小左上折线图
var mybigLineChartTop;        //放大时候之后的折线图
function CreateLineEchartTop(echartObj,ele,lname,xdata,sdata,ymax,ymin,tname){
function CreateLineEchartTop(echartObj,ele,lname,xdata,sdata,ymax,ymin,tname, specialPoint){
    if(echartObj=='myLineChartTop'){
        myLineChartTop=echarts.init(ele);
    }else if(echartObj='mybigLineChartTop'){
        mybigLineChartTop=echarts.init(ele);
    }
    myLineChartTop.group = 'group1';
    var option={
    let markLine = {};
    if(specialPoint && specialPoint.code) {
        markLine = {
            data: [{
                label: {
                    show: true,
                    position: 'end',
                    formatter: [
                        '{a|' + xdata[specialPoint.min] + '}' + '{c|}',
                        '{b|锅底电压:' + sdata[0][specialPoint.min] + 'V}' + '{c|}'
                    ].join('\n'),
                    rich: {
                        a: {
                        },
                        b: {
                        },
                        c: {
                            width: 60
                        }
                    },
                },
                xAxis: xdata[specialPoint.min],
            },
                {
                    label: {
                        show: true,
                        position: 'end',
                        formatter: [
                            '{c|}' + '{a|' + xdata[specialPoint.max] + '}',
                            '{c|}' + '{b|驼峰电压:' + sdata[0][specialPoint.max] + 'V}'
                        ].join('\n'),
                        rich: {
                            a: {
                            },
                            b: {
                            },
                            c: {
                                width: 80,
                            }
                        },
                    },
                    xAxis: xdata[specialPoint.max],
                }
            ]
        };
    }
    let option={
        tooltip:{
            trigger: 'axis'
        },
@@ -199,19 +249,20 @@
            show : true
        },
        title : {   
            text: "端电压折线图",
            text: specialPoint && specialPoint.code?tname:"端电压折线图",
            x: "center",     //标题水平方向位置
            textStyle: {  
                fontSize:13,
                align:'center'
            },
            subtext:tname,
            subtextStyle:{
                fontSize:13,
                align:'right'
            }
                fontSize:13,
                align:'center'
            },
            subtext: specialPoint && specialPoint.code?"":tname,
            subtextStyle:{
                fontSize:13,
                align:'right'
            }
        },
        legend: {
            show: false,
            data: lname,
            right: '4%',
            orient: 'vertical'
@@ -221,11 +272,11 @@
            data:xdata
        },
        grid: {
            left: '1%',
            right: '5%',
            bottom: '2%',
            containLabel: true
        },
            left: '1%',
            right: '5%',
            bottom: '2%',
            containLabel: true
        },
        yAxis:[{
            name:"y(V)"    ,
            type:'value',
@@ -233,32 +284,33 @@
            max:Math.ceil(ymax+1),
            precision:2,
            axisLabel:{
                formatter:function(value){
                    //解决原点处带符号问题
                    if(value==0)
                    {
                        return value;
                    }else{
                        return value ;
                    }
                }
            }
                formatter:function(value){
                    //解决原点处带符号问题
                    if(value==0)
                    {
                        return value;
                    }else{
                        return value ;
                    }
                }
            }
        }],
        series:function(){
            var serie=[];
            for( var i=0;i<sdata.length;i++){
                var item={
            let serie=[];
            for( let i=0;i<sdata.length;i++){
                    let item={
                    type:'line',
                    symbol:'none',
                    name:lname[i],
                    data:sdata[i],
                    itemStyle:{
                        normal:{
                            lineStyle:{
                                width:2
                            normal:{
                                lineStyle:{
                                    width:2
                                }
                            }
                        }
                    }
                        },
                        markLine: i==1?markLine:{}
                };
                serie.push(item);
            }