Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Highcharts:热图的共享工具提示_Javascript_Highcharts_Heatmap - Fatal编程技术网

Javascript Highcharts:热图的共享工具提示

Javascript Highcharts:热图的共享工具提示,javascript,highcharts,heatmap,Javascript,Highcharts,Heatmap,是否可以从Highcharts演示页面创建具有共享工具提示的热图,如本例所示: Highcharts.chart('container'{ xAxis:{ 类别:[ ‘一月’、‘二月’、‘三月’、‘四月’、‘五月’、‘六月’, ‘七月’、‘八月’、‘九月’、‘十月’、‘十一月’、‘十二月’ ] }, 工具提示:{ 分享:是的, 十字准星:对 }, 系列:[{ 数据:[29.9,71.5,106.4,129.2,144.0,176.0,135.6148.5,216.4194.1,95.6,54.

是否可以从Highcharts演示页面创建具有共享工具提示的热图,如本例所示:

Highcharts.chart('container'{
xAxis:{
类别:[
‘一月’、‘二月’、‘三月’、‘四月’、‘五月’、‘六月’,
‘七月’、‘八月’、‘九月’、‘十月’、‘十一月’、‘十二月’
]
},
工具提示:{
分享:是的,
十字准星:对
},
系列:[{
数据:[29.9,71.5,106.4,129.2,144.0,176.0,135.6148.5,216.4194.1,95.6,54.4]
}, {
数据:[216.4194.1,95.6,54.4,29.9,71.5106.4129.2,144.0176.0,135.6148.5]
}]
});

不幸的是,正如您所注意到的,工具提示。在热图系列中没有实现共享的功能。但是,您应该能够使用工具提示.formatter回调来显示每个类别的所有值

演示:

工具提示:{
格式化程序:函数(){
var series=此.series,
输出=''+getPointCategoryName(this.point,'x')+'已售出
'; series.points.forEach(p=>{ 如果(p.x==此点x){ 输出+='
'+ p、 “+getPointCategoryName(p,'y')+”上的值+”项 } }) 返回输出 } },
API:



我知道整列没有突出显示-这会干扰colorAxis的可读性

多谢各位。这似乎是一个简单的解决办法。
  tooltip: {
    formatter: function() {
      var series = this.series,
        output = '<b>' + getPointCategoryName(this.point, 'x') + '</b> sold <br><b>';
      series.points.forEach(p => {
        if (p.x === this.point.x) {
          output += '<br>' +
            p.value + '</b> items on<b> ' + getPointCategoryName(p, 'y') + '</b>'
        }
      })
      return output
    }
  },