| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx

Echarts插件,求简答获得不了option.legend.data属性

0
JavaScript Java HTML JSON C/C++ 14862 次浏览

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="../Common/Common/taglibs.jsp"%>
<html lang="en">

<head>

<meta charset="utf-8" />

<title>ECharts-基本线性图及其配置要求</title>
<script src="Static/js/MyChart/esl.js" type="text/javascript"></script>
</head>

<body>
  ${subSystemCodeList }
<div id="main" style="height: 400px; width:800px; border: 1px solid #ccc; padding: 10px;">

</div>

<script type="text/javascript" language="javascript">

// 按需加载

// Step:3 conifg ECharts's path, link to echarts.js from current page.

// Step:3 为模块加载器配置echarts的路径,从当前页面链接到echarts.js,定义所需图表路径

require.config({

paths: {

echarts: './Static/js/MyChart/echarts' //echarts.js的路径

}

});
       
     // 使用
        require(
            [
                'echarts',
                'echarts/chart/pie' // 使用柱状图就加载bar模块,按需加载
            ], DrawEChart //异步加载的回调函数绘制图表
        );
            function DrawEChart(ec) {
                // 基于准备好的dom,初始化echarts图表
                var myChart = ec.init(document.getElementById('main'));
               
                var option = {
    title : {
        text: '系统接口统计',
        subtext: '真实有效',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        orient : 'vertical',
        x : 'left',
        data:[]
    },
    toolbox: {
        show : true,
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {
                show: true,
                type: ['pie', 'funnel'],
                option: {
                    funnel: {
                        x: '25%',
                        width: '50%',
                        funnelAlign: 'left',
                        max: 1548
                    }
                }
            },
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    series : [
        {
            name:'数据统计',
            type:'pie',
            radius : '55%',
            center: ['50%', '60%'],
            data:[]
        }
       ]
};
                   
       

            $.ajax({ 
               type : "post", 
                async : false, //同步执行 
                url : "${pageContext.request.contextPath}/sysinter/getSysInter", 
                data : {}, 
                dataType : "json", //返回数据形式为json 
               success : function(result) { 
                    if (result) { 
                     alert(JSON.stringify(result));
                        option.legend.data = result.interfaceUDID; 
                        alert(option.legend);
                        option.series.data = result.cs; 
                      
                        myChart.hideLoading(); 
                        myChart.setOption(option); 
                    } 
                }, 
                error : function(errorMsg) { 
                    alert("不好意思,大爷,图表请求数据失败啦!"); 
                    myChart.hideLoading(); 
                } 
            }); 
        } 
    </script> 
   
</body>
</html>

6个答案

0

ดาวน์โหลดjoker123 auto Online slots, mobile phones, new online slots games, online slots that are the hottest in 2020, with low capital, can play.

0

ทางเข้า joker123 Top camp slots games Genuine license from PGSLOT game camp, online slots, direct web slot game service.

0

joker PG SLOT Game is a new and hot slot game that is gaining popularity right now, online slots, direct websites, not through agents.

0

เว็บตรง สล็อต PG SLOT online slots games A game that is popular with players all over the world right now. Your slots play will never be boring again.

0
0

I believe you are given the option of using your email address as another password-less feature with their services. The research paper writing services is a great place that helps me to know more about these codes.