Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/432.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 突出显示系列悬停高度图表_Javascript_Jquery_Highcharts_Hover_Highlight - Fatal编程技术网

Javascript 突出显示系列悬停高度图表

Javascript 突出显示系列悬停高度图表,javascript,jquery,highcharts,hover,highlight,Javascript,Jquery,Highcharts,Hover,Highlight,是否有一种方法可以使用Highcharts突出显示溢出,如附行的屏幕截图所示。我尝试了十字线设置,但没有考虑y轴的图例 提前感谢您的帮助 尝试使用renderer.rect()并更新其在鼠标上方的位置,请参见: 要添加框的代码: chart: { type: 'bar', events: { load: function () { this.highlight = this.renderer.rect

是否有一种方法可以使用Highcharts突出显示溢出,如附行的屏幕截图所示。我尝试了十字线设置,但没有考虑y轴的图例

提前感谢您的帮助


尝试使用
renderer.rect()
并更新其在鼠标上方的位置,请参见:

要添加框的代码:

    chart: {
        type: 'bar',
        events: {
            load: function () {
                this.highlight = this.renderer.rect(0, -100, 500, 40).attr({
                    fill: 'rgba(255,0,0,0.2)',
                    zIndex: 0
                }).add();
            }
        }
    },
要管理长方体,请执行以下操作:

                events: {
                    mouseOver: function () {
                        var h = this.series.chart.highlight;

                        if (h) {
                            // h.show();
                            h.attr({
                                y:  this.series.chart.plotTop - this.plotX + this.series.chart.plotHeight - h.height / 2
                            });
                        }
                    },
                    mouseOut: function () {
                        var h = this.series.chart.highlight;

                        if (h) {
                            // h.hide();
                        }
                    }
                }

请注意,mouseOut是可选的,只有当您离开容器或点时,想要隐藏盒子时才需要它。

谢谢您的回答,它非常完美!