Is there a method which I can run on a jquery element to detect if a chart is already rendered in the element? For example this code will always return true as .highcharts() is defined, what method or property should I check to see if a chart has been rendered and is this the correct approach to re-draw a chart with new data?
function draw (element, chartData) {
if( $(element).highcharts() ) {
$(element).highcharts().destroy();
}
$(element).highcharts( chartData);
}