Highcharts Example

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Highcharts Example</title>
        <script language="javascript" type="text/javascript" src="jqplot/jquery.min.js"></script>
        <style type="text/css">
${demo.css}
        </style>
        <script type="text/javascript">
$(function () {


    $.ajax({
           url:'PostRequest',
           //url:'MyJsp.jsp',
           type:'POST',
           data:{'aa':'aaabbbccc'},
           success: function(returnedData){
                    returnedData= {
        title: {
            text: 'Combination chart'
        },
        xAxis: {
            categories: ['响应时间', 'Oranges', 'Pears', 'Bananas', 'Plums']
        },
        
        series: [{
            type: 'column',
            name: 'Jane',
            data: [3.5, 2, 1, 3, 4]
        }, {
            type: 'column',
            name: 'John',
            data: [2, 3, 5, 7, 6]
        }, {
            type: 'column',
            name: 'Joe1',
            data: [4, 3, 3, 9, 0]
        }, {
            type: 'spline',
            name: 'Average',
            data: [3, 2.67, 3, 6.33, 3.33],
            marker: {
                lineWidth: 4,
                lineColor: Highcharts.getOptions().colors[3],
                fillColor: 'while'
            }
        }]
    };
                    
    $('#container').highcharts(returnedData);
                },
           statusCode: {
            404: function() {
              alert( "page not found" );
            }}
       });


});


        </script>
    </head>
    <body>
<script src="highcharts/js/highcharts.js"></script>
<script src="highcharts/js/modules/exporting.js"></script>

<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>

    </body>
</html>


你可能感兴趣的:(Highcharts Example)