zoukankan      html  css  js  c++  java
  • 每日总结

    1.热词分析实现

    部分代码:

    div align="center"><a target='_blank' href="find.jsp">论文查询</a></div>
    <body>
      <div id="main" align="center" style="height:300%;">
     
      </div>
      <div align="center"><input type="button" value="查询表格" onclick="table()" class="findbtn"></div><div id="creatable"></div>
      <script type="text/javascript">

        var dt;
        var hzb=new Array(0);
        var zzb=new Array(0);
       
                $.ajax({
                    url : "servlet?method=reci",
                    async : true,
                    type : "POST",
                    data : {        
                    },
                    dataType : "json",
                    
                    success : function(data) {
                        dt = data;                   
                         var mydata = new Array(0);
                         for (var i = 0; i < dt.length; i++) {
                              var d = {};
                              
                              d["name"] = dt[i].name;
                             
                              d["value"] = dt[i].value;
                              mydata.push(d);
                              hzb.push(dt[i].name);
                              zzb.push(dt[i].value);
                          }
                         //alert("mydata"+mydata);
                         var myChart = echarts3.init(document.getElementById('main'));
                         //设置点击效果
                        
                         
                         
                         myChart.setOption({
                             title: {
                                 text: ''
                             },
                             tooltip: {},
                             series: [{
                                 type : 'wordCloud',  //类型为字符云
                                     shape:'smooth',  //平滑
                                     gridSize : 8, //网格尺寸
                                     size : ['50%','50%'],
                                     //sizeRange : [ 50, 100 ],
                                     rotationRange : [-45, 0, 45, 90,60,16], //旋转范围
                                     textStyle : {
                                         normal : {
                                             fontFamily:'微软雅黑',
                                             color: function() {
                                                 return 'rgb(' +
                                                     Math.round(Math.random() * 255) +
                                              ', ' + Math.round(Math.random() * 255) +
                                              ', ' + Math.round(Math.random() * 255) + ')'
                                                    }
                                             },
                                         emphasis : {
                                             shadowBlur : 5,  //阴影距离
                                             shadowColor : '#333'  //阴影颜色
                                         }
                                     },
                                     left: 'center',
                                     top: 'center',
                                     right: null,
                                     bottom: null,
                                     '100%',
                                     height:'100%',
                                     data:mydata
                             }]
                         });    
                     var zhudiv=echarts3.init(document.getElementById('zhuzhuang'));
                    /* option = {
                                xAxis: {
                                    type: 'category',
                                    data: hzb
                                },
                                yAxis: {
                                    type: 'value'
                                },
                                
                                series: [{
                                    data: zzb,
                                    itemStyle: {
                                        normal: {
                                            label: {
                                                  show: true,
                                                  position: 'top',
                                                  textStyle: {
                                                    color: 'black'
                                              }
                                           }
                                        },
                                    },
                                    type: 'bar',
                                    showBackground: true,
                                    backgroundStyle: {
                                        color: 'rgba(180, 180, 180, 0.2)'
                                    }
                                }]
                            };
                     option && zhudiv.setOption(option);*/
                     
                    },
                    error : function() {
                        alert("请求失败");
                    },
               });
        
                function table(){
                    var cols=2; //5列
                    var rows=10; //4行
                    var div = document.createElement("div");
                    //div.className = "form-group";
                    div.id = "lotdiv" ;
                   
                    var htmlstr="<table border='2px' align='center'>";
                    for(i=0;i<=rows;i++){
                    htmlstr+="<tr>";
                    for(j=1;j<=cols;j++){
                        if(j==1){
                            if(i==0){htmlstr+="<td >" +"热词"+"</td>";}
                            else{htmlstr+="<td >" + dt[i-1].name +"</td>";}
                            
                        }
                        if(j==2){
                            if(i==0){htmlstr+="<td >" +"出现频率"+"</td>";}
                            else{htmlstr+="<td >" + dt[i-1].value +"次"+"</td>";}
                        }
                    }
                    htmlstr+="</tr>";
                    }
                    htmlstr+="</table>";
                     
                    div.innerHTML = htmlstr;
                    document.getElementById("creatable").appendChild(div);
                }
           


    </script>
    </body>
    </html>

  • 相关阅读:
    gdb调试libtool封装的可执行文件
    转载 Linux top命令详解
    VirtualBox使用物理硬盘建立磁盘
    【sqlServer】常用语句整理
    【c#基础】特殊集合
    【c# 基础】各种集合的不同情况下的性能
    【c#集合】Lookup 类 有序字典 SortedDictionary<TKey,TValue> 集
    【c#基础】集合--栈Stack 链表 LinkList 有序列表SortedList 字典Dictionary
    【c#基础】集合
    【c#基础】委托、Lambda表达式和事件
  • 原文地址:https://www.cnblogs.com/chenghaixiang/p/14914800.html
Copyright © 2011-2022 走看看