如何改变X和馅饼的Y轴名称图表高走势?(How to change the X and Y axis

2019-07-31 04:14发布

大家好我是一个饼图中的一些数据...片上的悬停我得到这样的悬停

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

我希望我的提示显示这样的

    [ProjectName=Hr,Logged Bugs=12]

我该怎么做this..here如何我为我的数据绑定到饼图

    <script type="text/javascript">
  $(function () {
      $.getJSON('<%= Url.Action("GetData","JqueryCharts") %>', {}, function (data) {
          var json = data;
          alert(json);
          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>

任何一个可以帮助在那里我必须改变这种

Answer 1:

默认情况下,Highchart工具提示中提示回升,系列名称。

您可以使用自定义工具提示:

tooltip: {
    formatter: function() {
          return '<b>ProjectName = '+ this.point.name +', Logged Bugs= '+ this.y + '</b>';
    }
}

这里是例子

Highchart具有很好的文档: http://api.highcharts.com/highcharts#tooltip



文章来源: How to change the X and Y axis names of Pie chart High Chart?