0
我正在使用JqPlot在jqplotMouseEnter和jqplotMouseLeave事件上显示一些图例。JqPlot EnhancedLegendRenderer with Mouse events
这是我的代码:
$('#FinancialsLineGraph').bind('jqplotMouseEnter', function(ev, seriesIndex, pointIndex, data) {
$('#FinancialsLineGraph .jqplot-table-legend').show();
});
$('#FinancialsLineGraph').bind('jqplotMouseLeave', function(ev, seriesIndex, pointIndex, data) {
$('#FinancialsLineGraph .jqplot-table-legend').hide();
});
通过该上面的代码中,当光标移动到该图内的实际说明,图例“闪烁”,并且用户不能使用EnhancedLegendRenderer所示/隐藏情节中的相应系列。
如何获得上述功能?
在此先感谢。
编辑
这里是我的JS代码的情节。
var plotCogsLineGraph = $.jqplot('FinancialsLineGraph', [[30,31,34,40,45], [34,38,31,42,38]],
{
axes:
{
xaxis:
{
ticks: ['5','4','3','2','1']
},
yaxis:
{
label:'%',
pad: 1.05,
ticks: ['0','15','30','45','60']
}
},
width: 480, height: 270,
legend:{show:true, location: 's', placement: 'insideGrid', renderer: $.jqplot.EnhancedLegendRenderer},
seriesDefaults:
{
rendererOptions: {smooth: true}
},
series:[
{
lineWidth:1,
label:'COGS',
markerOptions: { size:1, style:'dimaond' }
},
{
lineWidth:1,
label:'Wages',
markerOptions: { size: 1, style:"dimaond" }
}
]
}
);
我无法重现这一个 - 它在IE9,Chrome和FF中正常工作。你能展示JS如何创建剧情? – 2013-02-11 21:44:25
@nick_w:我已将JS代码添加到帖子中。 – user2023359 2013-02-11 22:15:09