【问题标题】:Highcharts y-axis plotlines label hides the tooltipHighcharts y轴绘图线标签隐藏工具提示
【发布时间】:2014-12-02 17:31:19
【问题描述】:

检查小提琴 - http://jsfiddle.net/4R5HH/209/ - 这只是为了测试。

我在 y 轴上有一个目标标签,当将鼠标悬停在它们上时会隐藏系列工具提示。

对此的任何解决方案。

$(function () {
$(document).ready(function() {
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            type: 'line'
        },
        title: {
            text: 'Dummy Data by Region'
        },
        xAxis: {
            categories: ['Africa', 'America', 'Asia']
        },
        yAxis: {
            plotLines:[{
                value:75,
                color: '#ff0000',
                width:2,
                zIndex:4,
                label:{text:'goal'},
                dashStyle: 'line',
                label: {
                    useHTML: true,
                    text: '<div class="targetLabel"><span>Target</span><br/><span style="font-weight: bold; padding-top: 5px;">' + '75' + '</span></div>',
                    align: 'center',
                    rotation: 0
                },
            }]
        },
        series: [{
            name: 'Year 1800',
            data: [107, 31, 50]
        },
                {
            name: 'Goal',
                    type: 'scatter',
                    marker: {
                enabled: false
            },
            data: [450]
        }]
    });
});

});

【问题讨论】:

  • 您好,请问您有什么问题吗?或者你想达到什么目标?
  • 您的意思是工具提示在“下方”,蓝色目标圆圈?
  • 工具提示隐藏在目标标签后面。那么如何在 Target 标签上方显示 tooltip。
  • 你需要禁用tooltip,并新建一个html div。因为你有两种类型的元素(html 和 SVG)

标签: highcharts


【解决方案1】:

从 Highcharts 论坛得到答案。 所以添加链接以供参考 - http://forum.highcharts.com/highcharts-usage/highcharts-y-axis-plotlines-label-hides-the-tooltip-t31539/

【讨论】:

  • 你必须在这里发布答案,而不仅仅是一个链接。
  • 它是一个 jsFiddle,所以最好将它作为链接。
猜你喜欢
  • 1970-01-01
  • 2020-01-09
  • 2015-05-18
  • 2023-03-25
  • 1970-01-01
  • 1970-01-01
  • 2012-05-30
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多