Haven't done much of this, but look at the GD library. AFAIK, dynamic vector based images are possible but can be a bit of work when done from scratch depending on complexity.
Possibly easier is to use a "blank" image and generate modifications to it.
E.g. a share price graph would probably work from a blank graph and dynamically add the data points.
N.B. Using the standard current GD libraries you can only generate JPG's or PNG's, not GIF's due to patent difficulties. However, most modern browsers accept PNG's so it's not too much of a limitation in practice.