You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When instantiating a line graph with multiple series on multiple y-axes, if a particular axis has only series with {show: false} it will die with a fatal error:
This error is slightly different but less helpful when using minified JQPlot.
An axis is undefined if all series assigned to it are set to {show: false} and therefore instead of just hiding the axis or plotting nothing. The undefined value causes a fatal error and JS kicks out without rendering the rest of the lines or applying other plugins that might be enabled.
Here is a simple example of code to reproduce the issue:
When series 2 and 3 (both on y2axis) are both hidden, the final orange series (on yaxis) never gets to render because of the error.
A workaround is to render the graph and then manually hide each series that shouldn't be there and re-plot the graph, but that should not be necessary, especially as {show: false} is a basic property built right into Series which simply breaks whole graphs.
The text was updated successfully, but these errors were encountered:
Adding {scaleToHiddenSeries: true} to axes which have only hidden series is a workaround, but it means that if series on a single axis have rather different scales (~10 vs ~50) can produce a lot of empty space if only one is shown.
When instantiating a line graph with multiple series on multiple y-axes, if a particular axis has only series with {show: false} it will die with a fatal error:
jQuery.Deferred exception: yp is undefined $.jqplot.LineRenderer.prototype.setGridData@http://atlas.bubbleupsandbox.ca/jqplot/jquery.jqplot.js:5584:71
This error is slightly different but less helpful when using minified JQPlot.
An axis is undefined if all series assigned to it are set to {show: false} and therefore instead of just hiding the axis or plotting nothing. The undefined value causes a fatal error and JS kicks out without rendering the rest of the lines or applying other plugins that might be enabled.
Here is a simple example of code to reproduce the issue:
let plot1 = jQuery.jqplot( 'chart1', [ [ [1, 578], [2, 566], [3, 480], [4, 509], [5, 454], [6, 379], [7, 303], [8, 308], [9, 299], [10, 346], [11, 325], [12, 386] ], [ [1, 428], [2, 466], [3, 390], [4, 419], [5, 374], [6, 309], [7, 233], [8, 228], [9, 189], [10, 236], [11, 205], [12, 256] ], [ [1, 248], [2, 336], [3, 250], [4, 279], [5, 254], [6, 179], [7, 153], [8, 108], [9, 99], [10, 146], [11, 125], [12, 186] ], [ [1, 678], [2, 666], [3, 580], [4, 609], [5, 564], [6, 469], [7, 503], [8, 438], [9, 389], [10, 466], [11, 475], [12, 456] ], ], { title:'Broken Axes', axes: { xaxis: { label: 'X-Axis', }, yaxis: { label : 'First Y-Axis', }, y2axis: { label : 'Second Y-Axis', }, }, series: [ { show: true, color: 'red', yaxis: 'yaxis', }, { show: false, color: 'blue', yaxis: 'y2axis', }, { show: false, color: 'purple', yaxis: 'y2axis', }, { show: true, color: 'orange', yaxis: 'yaxis', }, ], } );
Also at this JS Fiddle: http://jsfiddle.net/L4juxvd3/3/
When series 2 and 3 (both on y2axis) are both hidden, the final orange series (on yaxis) never gets to render because of the error.
A workaround is to render the graph and then manually hide each series that shouldn't be there and re-plot the graph, but that should not be necessary, especially as {show: false} is a basic property built right into Series which simply breaks whole graphs.
The text was updated successfully, but these errors were encountered: