Source code
Chart Features
This is a simple vertical barchart with bar labels connected to the top and bottom of the chart depending on the sign of the data:
-
The bars have labels which are connected to the bars by lines. If the bar is positive the label is at the top else it will be at the chart bottom.
-
The attributes which control the label position in this case are chart.barLabels.fixedEnd = LabelOffset()
- the labels will end at a dynamically controlled offset.
- self.chart.barLabels.fixedEnd.posMode='high'
- positive bars will be at the top of the chart: self.chart.barLabels.fixedEnd.pos = 10
- negative bars will have labels at the bottom: chart.barLabels.fixedEnd.negMode='low'
- with this y offset: chart.barLabels.fixedEnd.neg = -10
- the normal (positive case) labels will be anchored south: chart.barLabels.boxAnchor='s'
- Negative cases 'do the 'right thing' for boxAnchor and dy: self.chart.barLabels.dy = -1
This chart was built with our Diagra solution.
Not the kind of chart you looking for? Go up for more charts, or to see different types of charts click on ReportLab Charts Gallery.