added switch for charts