Highcharts学习札记-饼状图(内存使用监视)

Highcharts学习笔记-饼状图(内存使用监视)
function show(arr) {
      //alert(arr);
      var chart = new Highcharts.Chart({
        chart: {
          renderTo: 'container',
          plotBackgroundColor: null,
          plotBorderWidth: null,
          plotShadow: false
        },
        title: {
          text: 'Browser market shares at a specific website, 2010'
        },
        tooltip: {
          formatter: function() {
            return '<b>' + this.point.name + '</b>: ' + this.y + ' MB';
          }
        },
        plotOptions: {
          pie: {
            allowPointSelect: false,
            cursor: 'pointer',
            dataLabels: {
              enabled: true,
              color: '#000000',
              connectorColor: '#000000',
              formatter: function() {
                return '<b>' + this.point.name + '</b>: ' + this.y + ' %';
              }
            }
          }
        },
        series: [
          {
            type: 'pie',
            name: 'Browser share',
            data: arr
          }
        ]
      });
    }

 2、post请求数据

$.post("${createLink(controller:'main',action:'pie')}", {type:'json'}, function(data) {
        var arr = new Array();
        for (var i = 0; i < data.length; i++) {
          var tmp = new Array();
          tmp[0] = data[i].name;
          tmp[1] = data[i].memSize/1024;
          arr[i] = tmp;
        }
        show(arr);
      });

3、显示结果:


Highcharts学习札记-饼状图(内存使用监视)

 

1 楼 沙舟狼客 2011-08-26  
http://www.iteye.com/topic/281507
2 楼 sweetbaybelin 2011-10-15  
小胖,看看你啊。
3 楼 wenxiang_tune 2011-10-28  
哥们,你也用highchart啊  握爪。。。