• [struts2]struts结合ECharts的用法


    <script src="http://echarts.baidu.com/build/dist/echarts-all.js"></script>
    <script type="text/javascript">
    // 基于准备好的dom,初始化echarts图表
    var myChart = echarts.init(document.getElementById('main'));
    var pxlb= ['自评','初审','初评','终评'];
    <%-- var option = {
    tooltip: {
    show: true
    },
    legend: {
    data:['评审结果汇总']
    },
    xAxis : [
    {
    type : 'category',
    data : ["共性评分","共性总分","专项评分","专项总分"]
    }
    ],
    yAxis : [
    {
    type : 'value'
    }
    ],
    series : [
    {
    "name":"分数",
    "type":"bar",
    "data":[
    <s:iterator value="lsVevInfo" var="vinfo" status="st">
    <s:property value="resultValue" />,
    <s:property value="fullScore" />,
    <s:if test="resultValue == 0">0</s:if>
    <s:elseif test="resultValue != 0">
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
    <fmt:formatNumber value="${(resultValue)/(fullScore)*100}" pattern="0.00" />
    </s:elseif>
    <s:if test="!#st.Last">,
    </s:if>
    </s:iterator>
    ]
    }
    ]
    }; --%>

    option = {
    tooltip : {
    trigger: 'axis',
    axisPointer : { // 坐标轴指示器,坐标轴触发有效
    type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
    }
    },
    legend: {
    data:['共性要求评分','专项要求评分','共性要求总分','专项要求总分']
    },
    toolbox: {
    show : true,
    orient: 'vertical',
    x: 'right',
    y: 'center',
    feature : {
    mark : {show: true},
    dataView : {show: true, readOnly: false},
    magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
    restore : {show: true},
    saveAsImage : {show: true}
    }
    },
    calculable : true,
    xAxis : [
    {
    type : 'category',
    data : pxlb
    }
    ],
    yAxis : [
    {
    type : 'value'
    }
    ],
    series : [
    {
    name:'共性要求评分',
    type:'bar',
    data:[<s:iterator value="revMap.keySet()" id="key" status='s'>
    <s:iterator value="revMap.get(#key)" status='st'>
    <s:if test="#st.index == 0">
    <s:property value="resultValue" />
    </s:if>
    </s:iterator><s:if test="!#s.Last">,</s:if>
    </s:iterator>]
    },
    {
    name:'共性要求总分',
    type:'bar',
    data:[<s:iterator value="revMap.keySet()" id="key" status='s'>
    <s:iterator value="revMap.get(#key)" status='st'>
    <s:if test="#st.index == 0">
    <s:property value="fullScore" />
    </s:if>
    </s:iterator><s:if test="!#s.Last">,</s:if>
    </s:iterator>]
    },
    {
    name:'专项要求评分',
    type:'bar',
    data:[<s:iterator value="revMap.keySet()" id="key" status='s'>
    <s:iterator value="revMap.get(#key)" status='st'>
    <s:if test="#st.index == 1">
    <s:property value="resultValue" />
    </s:if>
    </s:iterator><s:if test="!#s.Last">,</s:if>
    </s:iterator>]
    },
    {
    name:'专项要求总分',
    type:'bar',
    data:[<s:iterator value="revMap.keySet()" id="key" status='s'>
    <s:iterator value="revMap.get(#key)" status='st'>
    <s:if test="#st.index == 1">
    <s:property value="fullScore" />
    </s:if>
    </s:iterator><s:if test="!#s.Last">,</s:if>
    </s:iterator>]
    }
    ]
    };

    // 为echarts对象加载数据
    myChart.setOption(option);
    </script>

  • 相关阅读:
    奇偶数排序
    买房子
    首字母大写
    学分绩点
    加减乘除
    最简真分数
    Hdu 1058 Humble Numbers
    Hdu 1032 The 3n + 1 problem
    Hdu 1040 As Easy As A+B
    Hdu 1025 Constructing Roads In JGShining's Kingdom
  • 原文地址:https://www.cnblogs.com/luoxiaolei/p/5048440.html
Copyright © 2020-2023  润新知