| 26 | | self.minxdelta = 0 |
| | 26 | self.minxdelta = 0.0 |
| | 27 | self.barWidthForSet = 0.0 |
| | 28 | self.barMargin = 0.0 |
| | 29 | |
| | 30 | def _updateChart(self): |
| | 31 | """Evaluates measures for vertical bars""" |
| | 32 | stores = self._getDatasetsValues() |
| | 33 | uniqx = uniqueIndices(stores) |
| | 34 | xdelta = min([abs(uniqx[j] - uniqx[j-1]) for j in range(1, len(uniqx))]) |
| | 35 | |
| | 36 | barWidth = 0 |
| | 37 | if len(uniqx) == 1: |
| | 38 | xdelta = 1.0 |
| | 39 | self.xscale = 1.0 |
| | 40 | self.minxval = uniqx[0] |
| | 41 | barWidth = 1.0 * self.options.barWidthFillFraction |
| | 42 | self.barWidthForSet = barWidth / len(stores) |
| | 43 | self.barMargin = (1.0 - self.options.barWidthFillFraction) / 2 |
| | 44 | else: |
| | 45 | self.xscale = 1.0 / (self.xrange + 1) |
| | 46 | barWidth = xdelta * self.xscale * self.options.barWidthFillFraction |
| | 47 | self.barWidthForSet = barWidth / len(stores) |
| | 48 | self.barMargin = (xdelta * self.xscale |
| | 49 | * (1.0 - self.options.barWidthFillFraction) / 2) |
| | 50 | |
| | 51 | self.minxdelta = xdelta |
| | 52 | self.bars = [] |
| 67 | | stores = self._getDatasetsValues() |
| 68 | | uniqx = uniqueIndices(stores) |
| 69 | | xdelta = min([abs(uniqx[j] - uniqx[j-1]) for j in range(1, len(uniqx))]) |
| 70 | | |
| 71 | | barWidth = 0 |
| 72 | | barWidthForSet = 0 |
| 73 | | barMargin = 0 |
| 74 | | if len(uniqx) == 1: |
| 75 | | xdelta = 1.0 |
| 76 | | self.xscale = 1.0 |
| 77 | | self.minxval = uniqx[0] |
| 78 | | barWidth = 1.0 * self.options.barWidthFillFraction |
| 79 | | barWidthForSet = barWidth / len(stores) |
| 80 | | barMargin = (1.0 - self.options.barWidthFillFraction) / 2 |
| 81 | | else: |
| 82 | | if self.xrange == 1: |
| 83 | | self.xscale = 0.5 |
| 84 | | elif self.xrange == 2: |
| 85 | | self.xscale = 1 / 3.0 |
| 86 | | else: |
| 87 | | self.xscale = (1.0 - 1 / self.xrange) / self.xrange |
| 88 | | |
| 89 | | barWidth = xdelta * self.xscale * self.options.barWidthFillFraction |
| 90 | | barWidthForSet = barWidth / len(stores) |
| 91 | | barMargin = (xdelta * self.xscale |
| 92 | | * (1.0 - self.options.barWidthFillFraction)/2) |
| 93 | | |
| 94 | | self.minxdelta = xdelta |
| 95 | | self.bars = [] |
| | 93 | super(VerticalBarChart, self)._updateChart() |
| 124 | | stores = self._getDatasetsValues() |
| 125 | | uniqx = uniqueIndices(stores) |
| 126 | | xdelta = min([abs(uniqx[j] - uniqx[j-1]) for j in range(1, len(uniqx))]) |
| 127 | | barWidth = 0 |
| 128 | | barWidthForSet = 0 |
| 129 | | barMargin = 0 |
| 130 | | if len(uniqx) == 1: |
| 131 | | xdelta = 1.0 |
| 132 | | self.xscale = 1.0 |
| 133 | | self.minxval = uniqx[0] |
| 134 | | barWidth = 1.0 * self.options.barWidthFillFraction |
| 135 | | barWidthForSet = barWidth / len(stores) |
| 136 | | barMargin = (1.0 - self.options.barWidthFillFraction) / 2 |
| 137 | | else: |
| 138 | | self.xscale = (1.0 - xdelta / self.xrange) / self.xrange |
| 139 | | barWidth = xdelta * self.xscale * self.options.barWidthFillFraction |
| 140 | | barWidthForSet = barWidth / len(stores) |
| 141 | | barMargin = xdelta * self.xscale * (1.0 - self.options.barWidthFillFraction) / 2 |
| 142 | | |
| 143 | | self.minxdelta = xdelta |
| 144 | | self.bars = [] |
| | 122 | super(HorizontalBarChart, self)._updateChart() |