echarts.jsp 895 B

123456789101112131415161718192021222324252627282930
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/webpage/include/taglib.jsp"%>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <title>ECharts</title>
  7. <meta name="decorator" content="ani"/>
  8. <!-- 引入 echarts.js -->
  9. <%@ include file="/webpage/include/echarts.jsp"%>
  10. </head>
  11. <body class="bg-white">
  12. <!-- 为ECharts准备一个具备大小(宽高)的Dom -->
  13. <div id="main" style="width: 100%;height: 100%"></div>
  14. <script type="text/javascript">
  15. // 基于准备好的dom,初始化echarts实例4
  16. var myChart = echarts.init(document.getElementById('main'));
  17. window.onresize = myChart.resize;
  18. $(function () {
  19. jp.get("${ctx}${dataURL}", function (option) {
  20. // 指定图表的配置项和数据
  21. // 使用刚指定的配置项和数据显示图表。
  22. myChart.setOption(option);
  23. })
  24. })
  25. </script>
  26. </body>
  27. </html>