Fixing pass by reference error in chart viz