简体   繁体   English

如何在高图热图悬停时突出显示单元格和yaxis刻度

[英]How to highlight cells and yaxis ticks on highcharts heatmap hover

I have a large heatmap, and because it's so large, I'm trying to highlight the cell when someone mouses over it, and I'd also like to highlight the y-axis tick as a time reference because of the large width of the chart. 我有一个很大的热图,并且因为它很大,所以我试图在有人将鼠标悬停在其上时突出显示该单元格,并且我也想突出显示y轴刻度作为时间参考,因为图表。 I've seen some examples of this, but my heatmap is not responding with hover effects. 我已经看到了一些示例,但是我的热图没有用悬停效果做出响应。

I've used this example to highlight the cells red, but it's not working. 我已使用此示例突出显示了红色的单元格,但是它不起作用。 http://jsfiddle.net/937twae7/ I've also researched this method for highlighting tick values, but it's probably not working for similar reasons. http://jsfiddle.net/937twae7/我也研究了此方法来突出显示刻度值,但是由于类似的原因,它可能无法正常工作。 https://jsfiddle.net/sjapdya6/1/ https://jsfiddle.net/sjapdya6/1/

In the "series" section of code, I've done this: 在代码的“系列”部分中,我这样做了:

...
states: {
  hover: {
    color: 'red'
  }
}
...

Here's my chart: https://jsfiddle.net/civilsurfer/Lhysx2vg/1/ 这是我的图表: https : //jsfiddle.net/civilsurfer/Lhysx2vg/1/

Nothing happens as I hover on the cells. 当我将鼠标悬停在单元格上时,什么也没有发生。

Thanks for any assistance. 感谢您的协助。

You used the boost module which increases performance, but causes some limitations - for example, the inability to change color in states. 您使用了boost模块,该模块可以提高性能,但会带来一些限制-例如,无法更改状态下的颜色。

To highlight an axis label you need to adjust the findTick function: 要突出显示轴标签,您需要调整findTick函数:

function findTick(point, ticks) {
    for (var tickValue in ticks) {
        if (tickValue == point.y) {
            return ticks[tickValue]
        }
    }
}

Live demo: https://jsfiddle.net/BlackLabel/agcper18/ 现场演示: https : //jsfiddle.net/BlackLabel/agcper18/

Docs: https://www.highcharts.com/docs/advanced-chart-features/boost-module 文件: https //www.highcharts.com/docs/advanced-chart-features/boost-module

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM