如何修改饼图中的工具提示,highcharts?

时间:2012-08-24 10:02:27

标签: asp.net-mvc-3 highcharts pie-chart

  

可能重复:
  How to change the X and Y axis names of Pie chart High Chart?

大家好我有一个饼图,其中每个切片显示一个默认的工具提示,如下所示

[Hr Resources:x=Hr Resources,y=12]

我想将此工具提示修改为

       [Project Name:Hr Resources,Logged Bugs:12] 

我希望工具提示如上所示......

这是我如何将数据绑定到饼图

   <script type="text/javascript">
  $(function () {
      $.getJSON('<%= Url.Action("GetData","JqueryCharts") %>', {}, function (data) {
          var json = data;              
          var jsondata = [];              
          for (var i in json) {
             // var serie = new Array(json[i].Projects, json[i].Bugs);
              jsondata.push([json[i].Projects, json[i].Bugs]);
          }              
      var chart = new Highcharts.Chart({
          chart: {
              renderTo: 'container',
              type: 'pie',
               plotBackgroundColor: null,
               plotBorderWidth: null,
               plotShadow: false
          },
           title: {
               text: 'Resource Reports of BugTracker'
           },              
          plotOptions: {
              pie: {
                  showInLegend: true,
                  animation: false,
                  allowPointSelect: true,
                  cursor: 'pointer'
              }
          },
          legend: {
              enabled: true
          },
          series: [{
              type: 'pie',
              name: 'Resource Reports',
              data: jsondata
          }]
      });
      });
  });
    </script>

0 个答案:

没有答案