added switch and bar-chart directive