pass data to chart in correct way