tracker issue : CF-4201268

select a category, or use search below
(searches all categories and all time range)
Title:

Refreshing and/or destroying a chart does not seem to work

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Ira Klotzko / Ira Klotzko ()

Created: 02/21/2018

Components: Charting/Graphing

Versions: 2016,11.0

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: Cold Fusion 11 update 11 / CF2018U5

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Windows 7 SP1 64-bit

Vote Count: 0

Problem Description: 

When creating a chart using ColdFusion it is sometimes necessary to refresh the HTML holding the chart, but not the entire page. This is often the case in SPAs (single-page applications). When doing this several events are still binded from the old chart to the document.body. This causes a large amount of javascript errors. If done enough times the application becomes sluggish, presumably from memory leaks.

This is not seen if we use the current version of ZingCharts (2.6.3)

Steps to Reproduce:

- Create a simple web page: button and div (id="mychart")
<button id="mybutton">refresh chart</button>
<div id="mychart"></div>
- Create a cfm page holding a simple line chart only (no html tags)
<cfchart><cfchartseries>....
- Use either a widget toolbox or Ajax inject the cfm page html into the web page whenever a user clicks the button
- Enable developer tools
- rollover the chart with mouse

NOTE: This is much much easier if you use a simple widget library where you can have a light-box contain the html of the chart. ala 
$('#mychart').createPanel({url: 'simpleChart.cfm'});
$('button#mybutton').on('click', function() {
 $('#mychart').panel('refresh', 'simple-chart.cfm');
});

Actual Result:

mouseout, mousemove, and mouseover event handlers trigger exceptions when moving mouse over chart

Expected Result:

no exceptions should occur

Any Workarounds:

Use 2.6.3 version of ZingCharts

Attachments:

Comments: