Ticket #22 (closed enhancement: fixed)
yvals above bars
| Reported by: | aprzywecki@… | Owned by: | somebody |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | component1 | Version: | |
| Keywords: | Cc: |
Description
I'm new to python and I'm not very familiar with pycha yet, so I'm not sure what the best way to do this is. My "hack" is to add:
######### render yvals above bars ###########
cx.save() cx.set_source_rgba(0, 0, 0, 1) label = unicode(bar.yval) extents = cx.text_extents(label) labelWidth = extents[2] labelHeight = extents[3] cx.move_to(x+(w/2.0)-labelWidth, y-labelHeight) cx.show_text(label) cx.restore()
after the bar proportions have been gathered in the drawBar method in bar.py (line 75). I set y tickCount to 0 in my options because I'm not sure how to handle overlapping.
There should obviously be an option for this. Maybe "showYvals". Other options might include placement ("over bar" or "inside bar"). I set my maxyval to be 30% more than my maximum yval to avoid drawing over the whole graph for the maximum bar.
