making charting dynamic