鍍金池/ 問答/HTML/ echarts4: Uncaught ReferenceError: m is

echarts4: Uncaught ReferenceError: m is not defined

Uncaught ReferenceError: m is not defined

clipboard.png

clipboard.png

    //分時(shí)圖
    var myChart2 = echarts.init(document.getElementById('main2'));

    var option2 = {
        tooltip: {
            trigger: 'axis',
        },
        grid: {
            show:true,
            left: '5%',
            right: '5%',
            containLabel: true,
            top:5,
            bottom:0
        },
        xAxis: {
            type: 'category',
            data: [],
            boundaryGap: false,
            gridIndex: 0,
            splitLine: {
                show: true
            },
            axisLabel:{
                color:'white'
            }
        },
        yAxis: {
            type: 'value',
            boundaryGap: false,
            min:'dataMin',
             max:'dataMax',
            axisLabel:{
                color:'white'
            }
        },
        series: [{
            data: [],
            type: 'line',
            symbol: 'none',
            lineStyle:{
                width:1
            },
            itemStyle: {
                normal: {
                    color: '#E2E0DD'
                },
            },
            areaStyle:{
                color:'#E2E0DD'
            }
        }]
    };

      setTimeout(function(){
    myChart2.setOption(option2);
    }, 1000);
    


    var nowproduct_no=   $("#nowproduct_no").val();
    $.get('__MODULE__/Point/getFenshitu?product='+nowproduct_no).done(function (data) {
      
        var data=JSON.parse(data);
        var Len=parseInt(data.data.length);

        setTimeout(function(){

        myChart2.setOption({
            xAxis: {
                data: data.time
            },
            series: [{
                name:'行情',
                data: data.data,

            }]
        });

        }, 1000);


    });


   
    window.setInterval(function () {

        var nowproduct_no=   $("#nowproduct_no").val();

        $.ajax({
            type: "post",
            url: "__MODULE__/Point/getFenshitu",
            data : "product="+nowproduct_no ,   //注意這里必須用=
            async: true,
            success: function (data) {

                var data=JSON.parse(data);
          
                var Len=parseInt(data.data.length);

                setTimeout(function () {

                    myChart2.setOption({
                        xAxis: {
                            data: data.time
                        },
                        series: [{
                            name: '行情',
                            data: data.data,
                        }]
                    });
                }, 1000);

            }
        });


    }, 1000);
回答
編輯回答
櫻花霓

你的接口是jsonp的?看樣子是接口的報(bào)錯(cuò)和echarts沒什么關(guān)系吧

2017年2月28日 17:58