working version with dynamic add/delete of chart