moving chart to controller