<!DOCTYPE html>
<html style="height: 100%;width: 100%;">

<head>
    <script src="ue.js"></script>
    <meta charset="utf-8">
</head>

<body style="height: 100%;width: 100%; margin: 0;font-size:1rem;line-height:150%;overflow-y: hidden;overflow-x:hidden;">
    <div id="container" style="height: 100%;width: 100%;"></div>
    <script type="text/javascript" src="jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="echarts.min.js"></script>
    <script type="text/javascript" src="ajax.js"></script>
    <script type="text/javascript">


        var dom = document.getElementById("container");
        var myChart = echarts.init(dom);
        var app = {};
        var option;

        function eacharsassignment(s) {
            console.log(s);



            var name = s.name;
            var dataX = s.dataX;
            var dataY1 = s.dataY1;
            var dataY2 = s.dataY2;
            var dataY3 = s.dataY3;
            var dataY4 = s.dataY4;
            option = {

                tooltip: {

                    trigger: 'axis',
                    axisPointer: {            // 坐标轴指示器,坐标轴触发有效
                        type: 'line'        // 默认为直线,可选为:'line' | 'shadow'
                    },
                    data: [name[0], name[1]]
                },
                color: ['#FFD700', '#FF2E15', '#F29D0C', '#43D1DF'],
                legend: {

                    icon: 'bar',

                    data: name,
                    left: "20",

                    textStyle: {
                        color: "#fff",
                    },
                    itemWidth: 12,
                    itemHeight: 10,
                    // itemGap: 35

                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },

                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    axisLabel: {
                        color: '#fff'
                    },
                    data: dataX
                },
                yAxis: {
                    type: 'value',
                    axisLabel: {
                        color: '#fff'
                    },
                },
                series: [
                    {
                        name: name[0],
                        type: 'line',
                        lineStyle: {
                            color: '#FFD700',
                            width: 4,
                        },

                        symbolSize: 0,
                        // stack: 'Total',
                        data: dataY1,
                        smooth: true,
                    },
                    {
                        name: name[1],
                        type: 'line',
                        lineStyle: {
                            color: '#FF2E15',
                            width: 2,
                        },
                        symbolSize: 0,
                        // stack: 'Total',
                        data: dataY2,
                        smooth: true,
                    },
                    {
                        name: name[2],
                        type: 'line',
                        lineStyle: {
                            color: '#F29D0C',
                            width: 2,
                        },
                        symbolSize: 0,
                        // stack: 'Total',
                        data: dataY3,
                        smooth: true,
                    },
                    {
                        name: name[3],
                        type: 'line',
                        lineStyle: {
                            color: '#43D1DF',
                            width: 2,
                        },
                        symbolSize: 0,
                        // stack: 'Total',
                        data: dataY4,
                        smooth: true,
                    }

                ]
            };

            if (option && typeof option === 'object') {

            }
            myChart.setOption(option);
        };




        ue.interface.setEchatsValue = function (s) {
            eacharsassignment(s);
            console.log(s);
        }
    </script>
</body>

</html>