It is just bound to happen, isn't it? Since I share the office with Kent, our QtScript guru, it is indeed a matter of time before a QtScript-based Graphics Dojo example falling from the sky. Here it is: a bar chart.
There are many ways to create your bar chart. You can use an office suite like OpenOffice.org. You can use the web-based API, such as Google Chart. You can also use insert-your-favorite-tool-here. What is shown below is the QtScript-based solution. Due to the nature of a scripting language, the data for the chart is actually inside the script, or rather it is one important piece of the script itself. Thus, creating a new chart is a matter of editing or adding new chart data and relaunch it. This eliminates the need for a routine that parses the input. Quite a time saver, isn't it? Combined with the lack of compiling step, resistance is futile.
The colors for each bar are generated automatically, see Helder's QQ 26 Adaptive Coloring for Syntax Highlighting for the general idea. If you do not favor the automatically picked colors, use the mouse wheel to change them (at once). Resizing the window allows you to find the optimum overall dimension for your chart. And once you are satisfied with the result, mouse click to save it to an image file.
To run the script, you need the bindings. Just grab that QtScript binding generator, build and run it (see its README), and the use the built qs_eval like:
Finally, if you want to creat a lot of bar charts, just split out the actual chart instantiation (line 122 onwards) into its own script file. This way, you can create a new chart with touching barchart.qs very often.
PS: I thank Kent for his help which made my first QtScript endeavor as smooth as it could be.