adds bar-chart and logic