zoukankan      html  css  js  c++  java
  • android 学习

    热词云,经过查资料后写出

    <script>
            
            var chart = echarts.init(document.getElementById('main'));
            var postURL = "/lunwen/ShowServlet";
            var mydata = new Array();
            $.ajaxSettings.async = false;
            $.post(postURL, {}, function(rs) {
                var dataList = JSON.parse(rs);
                for (var i = 0; i < dataList.length; i++) {
                    var d = {};
                    d['name'] = dataList[i].name;
                    d['value'] = dataList[i].value;
                    mydata.push(d);
                }
            });
            $.ajaxSettings.async = true;
            var option = {
                tooltip : {},
                series : [ {
                    type : 'wordCloud',
                    gridSize : 5,
                    sizeRange : [ 20, 40 ],
                    rotationRange : [ -90, 90 ],
                    shape : 'pentagon',
                    width : 20000,
                    height : 12000,
                    drawOutOfBound : false,
                    textStyle : {
                        normal : {
                            color : function() {
                                return 'rgb('
                                        + [ Math.round(Math.random() * 160),
                                                Math.round(Math.random() * 160),
                                                Math.round(Math.random() * 160) ]
                                                .join(',') + ')';
                            }
                        },
                        emphasis : {
                            shadowBlur : 10,
                            shadowColor : '#333'
                        }
                    },
                    data : mydata
                } ]
            };
             chart.setOption(option);
            chart.on('click', function(params) {
                var url = "ClickServlet?name=" + params.name;
                window.location.href = url;
            });           
            </script>

  • 相关阅读:
    如何为创建大量实例节省内存?
    4-5
    4-6
    4-4
    4-3
    4-2
    3-11
    4-1
    3-10
    3-8
  • 原文地址:https://www.cnblogs.com/Nojava/p/14909032.html
Copyright © 2011-2022 走看看