简体   繁体   English

Highchart工具提示问题

[英]Highchart tooltip issue

In my current project we are using Hightchart to show charts for various analysis. 在我当前的项目中,我们正在使用Hightchart显示图表以进行各种分析。 In line chart we are showing tooltip on hover. 折线图中,我们在悬停上显示工具提示。 when there are only two series(two lines) charts renders successfully and show tooltip when it exceeds from 2 then charts renders successfully but tooltip only getting displayed for intial two lines. 当只有两个系列(两行)时,图表会成功渲染,并在超过2时显示工具提示,然后图表会成功渲染,但工具提示仅针对前两行显示。 How can i show tooltip for all the lines when it exceeds from 2. below the code snippet of plotOptions and series data. 当它超出 plotOptions和序列数据的代码片段的2.以下时,如何显示所有行的工具提示

  plotOptions: {
                area: {
                    fillOpacity:0.0001,
                    lineWidth: 2,
                    marker: {
                        enabled: false
                    },
                    shadow: false,
                    states: {
                        hover: {
                            lineWidth: 2
                        }                   
                    },                     
                    tooltip: {
                        headerFormat: '<span style="font-size:10px">{point.key}</span><br><table style="height:auto;width:300px;white-space:normal !important;overflow:auto">',
                        pointFormat: '<tr><td style="color:black;font-weight:normal;padding:2px;text-align: justify">{series.name}: </td>' +
                            '<td style="color:black;font-weight:normal;padding:0">{point.y}</td></tr>',
                        footerFormat: '</table>',
                        shared: true,
                        useHTML: true
                    },
                    threshold: null
                }
            }

below is series: data 以下是series:数据

[{"name":"Text1","type":"area","data":[[1262304000000,367],[1293840000000,0.1],[1325376000000,387],[1356998400000,397],[1388534400000,407]]},
{"name":"Text2","type":"area","data":[[1262304000000,272],[1293840000000,1.1],[1325376000000,292],[1356998400000,302],[1388534400000,312]]},
{"name":"Text3","type":"area","data":[[1262304000000,916],[1293840000000,2.1],[1325376000000,936],[1356998400000,946],[1388534400000,956]]},
{"name":"Text4","type":"area","data":[[1262304000000,546],[1293840000000,3.1],[1325376000000,566],[1356998400000,576],[1388534400000,586]]},
{"name":"Text5","type":"area","data":[[1262304000000,726],[1293840000000,4.1],[1325376000000,746],[1356998400000,756],[1388534400000,766]]},
{"name":"Text6","type":"area","data":[[1262304000000,774],[1293840000000,0.2],[1325376000000,794],[1356998400000,804],[1388534400000,814]]}] 

update: I further investigated and found it shows tooltip for all when we start mouse hover from either start or end point of line in the chart but it doesn't show tooltip if start hovering line anywhere apart from starte or end point 更新:我进一步调查并发现,当我们从图表的直线的起点或终点开始悬停鼠标时,它会显示所有工具提示,但如果在起点或终点之外的任何地方开始将鼠标悬停在该位置,则不会显示工具提示

Do you mean something like this : http://jsfiddle.net/vr9B8/ ? 您的意思是这样的吗: http : //jsfiddle.net/vr9B8/

 tooltip: {
        formatter:function() {

            var len = this.series.chart.series.length - 1;
            if(len > 2)
                return 'content of tooltip';
            else
                return false;       
        }
    },

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

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