用highchart实现表格的jsp写法

var Report = function(){     
      var xtitle = "";
      var yAxisTitle = "比例 (单位 : %)";
      var  subxtitle = '来源 : ;       
      this.url = '/ps/coort!quour.action';      
         this.data = {}; 
        
       this.ajax = function(){       
        $.ajax({
         url: this.url,
         data: this.data,        
         success : this.connectRateCharts  
       });      
       } //end ajax
       
       this.connectRateCharts = function(data){
           // alert(data);          
        chartData = eval("("+data+")");               
        chartData[2] = eval("["+chartData[2]+"]");        
        if(chartData[2]==""){
            $.messager.alert('提示','无数据,请更换查询 。 ','info');
           } 
                 
           chart = new Highcharts.Chart({
                 chart: {
                     renderTo: 'container',
                     type: 'line',
                     marginRight: 50,
                     shadow : true,
                     marginBottom: 70
                 },
                 title: {
                     text: xtitle,
                     x: -20 //center
                 },
                 subtitle: {
                     text: subxtitle,
                     x: -20,
                     y: 35
                 },
                 xAxis: {
                     categories: chartData[0]
                 },
                 yAxis: {
                     title: {
                         text: yAxisTitle
                     },
                     plotLines: [{
                         value: 0,
                         width: 1,
                         color: '#808080'
                     }],
                     allowDecimals:true                     
                 },
                 tooltip: {
                 enabled: false,
                     formatter: function() {
                             return '<b>'+ this.series.name +'</b><br/>'+
                             this.x +' : '+ this.y +'%';
                     }
                 },
                  plotOptions: {
                      line: {
                          dataLabels: {
                              enabled: true
                          },
                          enableMouseTracking: false
                      }
                  },          
                 legend: {                    
                     x: 0,
                     y: 0
                 },
                 series: [{
                     name: chartData[1],
                     data: chartData[2]
                 },{
                        name: "时间:" + chartData[3]
                        }]
             });  //end chartData
       }       
       //切换时间控件
       this.checkDisplayTime = function(s){       
       }  
     }//end report

 

         var report = new Report();
      //初始加载
        $('#startTime').val(nowDate);
        $('#endTime').val(nowDate);  
             
        report.data = {  
                  startTime:$('#startTime').val(),
               endTime:$('#endTime').val(),
               connectType:connectTypeValue
           }; 
        //初始加载
        report.ajax(); 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值