I would like to use a Javascript library (Flot) to generate charts in my application. Most of the time, the charting will be performed by clients. However, I can see that in some cases, where the same charts would be frequently accessed by all clients, it would be better to generate those charts on the server, cache them, and serve them as images.
How could I go about executing Javascript from a script that runs on the server? Can Flot be used to generate PNG's?