Source code
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. Unlike the 01 version this chart connects the axis end of the bar to the label.
Chart Features
This chart demonstrates different unique features such as
-
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
-
self.chart.barLabels.fixedEnd = LabelOffset() the labels will end at a dynamically controlled offset.
-
self.chart.barLabels.fixedEnd.posMode='low' positive bars will be at the bottom of the chart
-
self.chart.barLabels.fixedEnd.pos = -10 with this offset.
-
self.chart.barLabels.fixedEnd.negMode='high' negative bars will have labels at the top
-
self.chart.barLabels.fixedEnd.neg = 10 with this y offset
-
self.chart.barLabels.boxAnchor='n' the normal (positive case) labels will be anchored st their north side.
-
self.chart.barLabels.dy = -1 with this small adjustment. Negative cases 'do the 'right thing' for boxAnchor and dy.
-
self.chart.barLabels.fixedStart = LabelOffset() this object fixes the start of the lines
-
self.chart.barLabels.fixedStart.posMode='axis' at the axis for both positive
-
self.chart.barLabels.fixedStart.negMode='axis' and negative bars.
-
This chart was built with our Diagra solution.
Not the kind of chart you looking for? Do not worry go [up][up_link] for more charts, or to see different types of charts click on ReportLab Charts Gallery.