From: James Byers <jbyers@gm...> - 2004-11-19 07:27:54
Earlier this week, I took a crack at adding rudimentary point
highlighting, text, and padding functions to Sparkline. The changes
are in CVS. However, I think there's a better path on how to
implement these features long term, so I'm resisting packaging up an
0.2. You can see rendered examples at:
http://sparkline.sourceforge.net/ (stock charts)
The path I took was to add a SetFeaturePoint method in Sparkline_Line.
This is convenient and quick, but as a result of the order of
operations (all Sets before Render), SetFeaturePoint does not do the
drawing operation itself, rather it simply stores values for use in
Render. This path will overcomplicate Render and duplicate common
code in each graph class.
Instead, I'm imagining a Sparkline_Feature superclass with
Sparkline_Point, Sparkline_Range, ... subclasses. To create a
feature, you would instantiate the appropriate feature class and bind
to your Sparkline_XXX object. Render would then traverse its list of
feature objects and render each one (or have the features render
The bottom line of all this is have a look at the current CVS version
if you're interested in the beginnings of features - but be aware the
implementation will likely change quite a lot before the next release.
I've assigned myself these features on the status page for 0.2.
As always, let me know if you're interested in tackling anything on
the status page list or have examples of the library "in the wild".
Get latest updates about Open Source Projects, Conferences and News.