1

我正在使用带有图例插件的 JQPlot通过单击其图例名称来切换系列显示。

    legend: {
        show: true,
        placement: 'outsideGrid',
        renderer: $.jqplot.EnhancedLegendRenderer
    }

它正在工作,但在隐藏系列时始终显示系列工具提示。如果您有很多系列并且想要隐藏除一个之外的所有系列,这是一个问题:隐藏系列的所有工具提示都显示在鼠标悬停时。

这是一个解释问题的小提琴:http: //jsfiddle.net/Bouillou/WdLnm/284/

4

1 回答 1

1

I experienced this bug a while back. See my post on the jqPlot Google group: https://groups.google.com/forum/?fromgroups#!searchin/jqplot-users/nickw/jqplot-users/PShgGTuXpeg/m3NPzEIWRscJ

Essentially, the code is checking to see if each line is visible before raising an event. The problem is that the visibility is not being dealt with correctly on the Javascript side (the CSS is fine), hence the issue you are seeing where a hidden series is still deemed visible.

My solution was to set s.show = s.canvas._elem.is(':hidden'); in the Series.prototype.toggleDisplay method.

This appears to have been resolved since version 1.0.4r1120 - try updating to a more recent version to see if that helps.

于 2012-12-01T23:33:59.557 回答