chart to global variable