Issue #685 new

enhancedLegendRenderer hiding series

Anonymous created an issue

I attempted to use the Enhanced Legend Renderer(im going to refer to as ELR) to click to hide series. It worked perfect as long as you didnt want to re-scale the y axis. Following some of the properties of the ELR i found seriesToggleReplot. I looked at the ELR code and found that while it did replot it didn't keep the same graphing properties that i had assigned to my plot in the first place! I have made the following changes to the code to allow seriesToggleReplot to work properly.

jqplot.enhancedLegendRenderer.js in function doLegendToggle change var opts = {}; to var opts = plot.options;

And Add Line opts.series[sidx].show = opts.series[sidx].show == undefined || opts.series[sidx].show ? false : true; before plot.replot(opts);

jqplot.js In function $.jqplot.LineRenderer.prototype.makeGridData Add Line if(xp == undefined || yp == undefined) return; After var yp = this._yaxis.series_u2p;

In function $.jqplot.LineRenderer.prototype.setGridData Add Line if(xp == undefined || yp == undefined) return; After var yp = this._yaxis.series_u2p;

I have attached the both the jqplot.js and the jqplot.enhancedLegendRenderer.js

Comments (0)

  1. Log in to comment