Flash is dead. It's not on way out, it's not just begun to get phased out, it's dead.
For charting you likely do not want to roll your own. Check out charting packages such as
HighCharts or (if you really want to get your hands dirty)
D3.js. There are others as well.
Between JavaScript, the canvas, and SVG support, drawing doesn't need to happen statically on the server anymore.