EnhancedLegendRenderer Bug and Fix

tathibo1 avatartathibo1 created an issue

Ive been getting "TypeError: this.legend._elem is undefined" when using jqplot.enhancedLegendRenderer.js. The error occurs on line 301 and may be fixed by adding a check for existance in the conditional on line 300.

if (this.legend.renderer.constructor == $.jqplot.EnhancedLegendRenderer && this.legend.seriesToggle){


if (this.legend.renderer.constructor == $.jqplot.EnhancedLegendRenderer && this.legend.seriesToggle && this.legend._elem){

Comments (2)

  1. Kevin Fernandes

    I can repeat this issue in Chrome. If legend.show is set to false then legend._elem is null. I have not tried this with a different browser so I cannot confirm otherwise.

    I can confirm the suggested fix above does indeed work.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.