码迷,mamicode.com
首页 > 其他好文 > 详细

客户端

时间:2015-05-27 22:37:37      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html>
<head>
<title>MyHtml.html</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta name="content-type" content="text/html; charset=UTF-8">

<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

</head>
<body>
    <!--      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> 
      <script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
      <script type="text/javascript" src="../js/highcharts.js"></script>-->
    <script src="http://cdn.hcharts.cn/jquery/jquery-1.8.3.min.js"></script>
    <script src="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>
    <script type="text/javascript">
    var json;
        $(function() {
            $(#show-button).on(click, function(e) {
                showChart();
            });
        });

        var chart;
        function showChart() {
            $.ajax({
                url : "servlet/Charts",
                type : "POST",
                dataType : "json",
                data : {
                    "que" : $("#inputque").val()
                },
                success : function(data) {
                    json = eval(data);
                    if (json != "" && json != null) {
                        chart = new Highcharts.Chart({
                            chart : {
                                renderTo : container,
                                type : line
                            },
                            title : {
                                text : 话题趋势分析
                            },
                            subtitle : {
                                text : ‘‘
                            },
                            xAxis : {

                                categories : json.categories,
                                id : temperature-axis
                            },
                            yAxis : {
                                title : {
                                    text : 百分比 (%)
                                },
                                min : 0
                            },
                            plotOptions : {
                                line : {
                                    dataLabels : {
                                        enabled : true
                                    },
                                    enableMouseTracking : true
                                }
                            },
                            tooltip : {
                                formatter : function() {
                                    return <b> + this.series.name + 出现在
                                            + </b><br/> + this.x + : 
                                            + this.y + ;
                                }
                            },
                            series : json.series

                        });
                    }
                    $("#text").val(json.aaf); 
                    
                },
                error : function() {
                    alert(error!);
                }
            });
        }

        //document.getElementByIdx_x("text").value = json.aaf;
        //document.getElementById("text").InnerText = "xxx"; 

    </script>


    <div style="margin:auto;text-align:center;">
        <div style="padding:10px;">
            <input type="text" name="que" id="inputque"> <input
                type="button" id="show-button" value=" Test Highcharts " />
        </div>


        <div id="container"
            style="height:480px;width:980px;background-color:#efefef;"></div>
        <textarea name="yj" rows="5" cols="20" wrap="hard" id = "text">
        </textarea>
        <a href="<%=request.getContextPath()%>/show.jsp"><input type="button"></input></a>
        
    </div>
    
    

    
</body>
</html>

 

客户端

标签:

原文地址:http://www.cnblogs.com/XDJjy/p/4534508.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!