在工具提示高级图表上使用外部数据

时间:2018-11-14 19:03:24

标签: highcharts tooltip

我有一个Highchart,其中显示了员工满意度调查结果的平均值。

例如,员工A在1月(2、5、8)获得了3个评分,平均评分为5,因此我在该月显示5。我得到一个包含月份平均值的数组,并将其放在图表上。 “一月平均,二月...”。

现在,我不需要在工具提示上显示平均值,而是员工在给定月份收到的平均金额。

我已经准备好了每个月的数量的数组,但无法在所需的位置显示它。

我正在尝试在工具提示上显示此数据,它位于一个数组中,但是它显示了整个数组,而不是每个意向仅显示一个。

我该怎么做?我不知道。

Highcharts.chart(pessoa, {
    chart: {
      type: 'column'
    },
    title: {
      text: pessoa
    },
    subtitle: {
       text: 'Média por mês'
    },
    xAxis: {
       categories: meses,
       crosshair: true
    },
    yAxis: {
       min: 0,
       title: {
         text: 'Média'
       }
    },
   tooltip: {
      headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
      pointFormat: '<tr><td style="color:{series.color};padding:0"> 
      {series.name}: </td>' +
      '<td style="padding:0"><b>{point.y:.2f}</b></td><br> Total:' + R(resposta) + '</tr>',
      footerFormat: '</table>',
      shared: true,
      useHTML: true
   },
   plotOptions: {
      column: {
   pointPadding: 0.2,
   borderWidth: 0,
  stacking: 'normal',
  dataLabels: {
    enabled: true,
    color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'black'
  }

 }
},
 series: [{
 name: 'Média',
 data: nota1

 }]
});

变量 nota1 是系列(平均值)。

The chart at the moment

0 个答案:

没有答案