0001-dataviz-truncate-legend-taking-account-the-pie-graph.patch
combo/apps/dataviz/models.py | ||
---|---|---|
554 | 554 |
chart.x_labels = [pygal.util.truncate(x, 15) for x in chart.x_labels] |
555 | 555 |
else: |
556 | 556 |
chart.show_legend = True |
557 |
if width and width < 500: |
|
558 |
chart.truncate_legend = 15 |
|
557 |
if width and height: |
|
558 |
# pies are as tall as wide, reserve the appropriate space and distribute |
|
559 |
# the rest for the legend. |
|
560 |
chart.truncate_legend = (width - height) // 10 |
|
561 |
elif width: |
|
562 |
chart.truncate_legend = width // 20 |
|
559 | 563 | |
560 | 564 |
def process_one_dimensional_data(self, chart, data): |
561 | 565 |
if self.hide_null_values: |
562 |
- |