|
|
|
@ -97,7 +97,7 @@ class BaseGraph(object):
|
|
|
|
|
if self.show_legend and self.series: |
|
|
|
|
h, w = get_texts_box( |
|
|
|
|
map(lambda x: truncate(x, self.truncate_legend or 15), |
|
|
|
|
cut(self.series + self.secondary_series, 'title')), |
|
|
|
|
cut(self.series, 'title')), |
|
|
|
|
self.legend_font_size) |
|
|
|
|
if self.legend_at_bottom: |
|
|
|
|
h_max = max(h, self.legend_box_size) |
|
|
|
@ -106,6 +106,19 @@ class BaseGraph(object):
|
|
|
|
|
else: |
|
|
|
|
self.margin.right += 10 + w + self.legend_box_size |
|
|
|
|
|
|
|
|
|
if self.show_legend and self.secondary_series: |
|
|
|
|
h, w = get_texts_box( |
|
|
|
|
map(lambda x: truncate(x, self.truncate_legend or 15), |
|
|
|
|
cut(self.secondary_series, 'title')), |
|
|
|
|
self.legend_font_size) |
|
|
|
|
if self.legend_at_bottom: |
|
|
|
|
h_max = max(h, self.legend_box_size) |
|
|
|
|
self.margin.bottom += 10 + h_max * round( |
|
|
|
|
sqrt(self._order) - 1) * 1.5 + h_max |
|
|
|
|
else: |
|
|
|
|
self.margin.left += w + self.legend_box_size |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if self.title: |
|
|
|
|
h, _ = get_text_box(self.title[0], self.title_font_size) |
|
|
|
|
self.margin.top += len(self.title) * (10 + h) |
|
|
|
|