Package Gnumed :: Package timelinelib :: Package canvas :: Package drawing :: Package drawers :: Module legenddrawer :: Class LegendDrawer
[frames] | no frames]

Class LegendDrawer

source code

The legend is a box containing one item row for each category displayed in a timeline. An item contains a text and colored box. The text is the category text and the color is the color of the category. The legend box can be placed at different locations on the Teimeline panel. When measures are calculated it's assumed that it will be placed in the upper left corner:

                                 OP
      IP                        |  | 
     |  |              >|   |< text_height
     +--------------------------+---
     |                          |    IP
     |                  +---+   |---
     |   Xxxxxxx yyyy   |   |   |
     |                  +---+   |---
     |                          |    IP
     |                  +---+   |---
     |   Xxxxxxx yyyy   |   |   |    text_height
     |                  +---+   |---
     |   |          |     :     |
     |    text_width      :     |
     |                    :     |
     +--------------------------+
                     |  |    |  |
                      OP      IP
Instance Methods
 
__init__(self, dc, scene, categories) source code
 
draw(self)
Draw the legend on the Timeline panel.
source code