Bagan JS Clear Out Chart

if( typeof window.myChart2 !== 'undefined'){                                  
    window.myChart2.destroy();                                                
} 
Friendly Hawk