pass data variable to chart creating fn