0

次のオプションを備えたjQplotがあります。

options= {
                title:"Results", 
                legend:{
                   renderer: $.jqplot.EnhancedLegendRenderer,
                   show:true,
                   labels:result,
                   rendererOptions:{
                       numberRows:null,
                       numberColumns:4,
                       seriesToggle:"fast",
                       disableIEFading:true
                   },
                   placement: 'outsideGrid',
                   location: 's'
                },
                axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer, tickOptions:{formatString:'%Y-%m-%d %H:%M'}},
                      highlighter: {

                       sizeAdjust: 10,

                       tooltipLocation: 'n',

                       useAxesFormatters: false,

                       formatString: 'Hello %s dayglow %d'

                   }
                },
                   cursor:{ 
                      show: true,
                      zoom:true, 
                      showTooltip:false
                   } };

行が非表示になっているときにハイライトを無効にしたいのですが。現在、非表示のデータポイントにカーソルを合わせると、蛍光ペンが表示されます。これを行う方法はありますか?

4

3 に答える 3

1

再描画する前に、シリーズの「showHighlight」属性を「show」属性と同期させておく必要があります。

于 2011-07-27T10:20:28.293 に答える
1

私はなんとか解決策を見つけることができました。現在、jqplotバージョン1.0.0b2_r1012を使用しています。

EnhancedLegendRenderer.js(そのファイルまたは.min.jsのどちらをインクルードしたかに注意してください)に移動し、 handleToggle関数(219行目)を次のように修正します。

var handleToggle = function (ev) {
    ev.data.series.toggleDisplay(ev);
    if (ev.data.series.canvas._elem.hasClass('jqplot-series-hidden')) {
        $(this).addClass('jqplot-series-hidden');
        $(this).next('.jqplot-table-legend-label').addClass('jqplot-series-hidden');
        $(this).prev('.jqplot-table-legend-swatch').addClass('jqplot-series-hidden');
        ev.data.series.showHighlight = false;
    }
    else {
        $(this).removeClass('jqplot-series-hidden');
        $(this).next('.jqplot-table-legend-label').removeClass('jqplot-series-hidden');
        $(this).prev('.jqplot-table-legend-swatch').removeClass('jqplot-series-hidden');
        ev.data.series.showHighlight = true;
    }
};

行を追加しました:

ev.data.series.showHighlight = false;

ev.data.series.showHighlight = true;

注意: この修正は長期的な解決策ではありません!次回jqplotを更新するときは、これらの行も更新する必要があります。これらの行を更新する前に、天気を確認してください。このバグは、そのjqplotバージョンで修正されています。

于 2012-08-09T12:26:03.363 に答える
1

重要! この問題は、最新のjqplotバージョンで修正されています。

于 2012-08-27T09:57:35.547 に答える