Hello,

On Wed, Aug 31, 2011 at 6:01 AM, Yoann Padioleau <[email protected]> wrote:
> Also is there a function to display stacked graphs, as in many-eyes:
> http://www-958.ibm.com/software/data/cognos/manyeyes/page/Stack_Graph_for_Categories.html
> On Aug 30, 2011, at 8:35 PM, Yoann Padioleau wrote:
>>
>> Just installed it. Works fine. But I could not find a way to draw the legend
>> and label manually things.

I'm sorry, when I said labels weren't implemented yet, I meant the legend.
You may find an example use of labels in the "Text_labels" test.

You can place the legend manually using Viewport.text using the `Graph
or `Device coordinates (normalized coordinates of resp. the graph window
and the viewport) and playing with paths for making your legend box.
For example, you can place the text with:
  Viewport.text vp ~coord:`Graph 1. 1. ~pos:Backend.LB "Banana";

>> For instance on
>> Food  2000    2001    2002    2003
>> Banana        4       5       5       2
>> Lemon         1       2       3       4
>> Orange        2       2       1       3
>>
>> What would be the call to Archimedes.stack ...
>> to get the stacked bars with the right labeling and not too bad color (let's 
>> say red/green/blue for banana/lemon/orange).

I invite you to check the latest bazaar trunk and take a look at the
test "Plot_stack" where you set the style to `Lines with :
  A.Array.stack vp ~style:`Lines data;
If the predefined colors doesn't suit your needs, you can specify your
own array of colors via the ?fillcolors optional.

If you have further specific questions on the use of Archimedes, I
invite you to discuss them offlist.

Thank you for your interest in Archimedes,
Pierre Hauweele


-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to