Browse Source

Fixes

pull/8/head
Florian Mounier 13 years ago
parent
commit
21cd57f678
  1. 5
      pygal/css/graph.css
  2. 13
      pygal/graph/graph.py

5
pygal/css/graph.css

@ -53,10 +53,13 @@ svg * {
.legends .legend text { .legends .legend text {
font-family: monospace; font-family: monospace;
font-size: {{ font_sizes.legend }}; font-size: {{ font_sizes.legend }};
stroke: {{ style.foreground }};
fill: {{ style.foreground }};
} }
.legends .legend:hover text { .legends .legend:hover text {
stroke: {{ style.foreground_light }}; stroke: {{ style.foreground_light }};
fill: {{ style.foreground_light }};
} }
.axis text { .axis text {
@ -121,7 +124,7 @@ svg * {
fill-opacity: {{ style.opacity }}; fill-opacity: {{ style.opacity }};
} }
.reactive.active { .reactive.active, .active .reactive {
fill-opacity: {{ style.opacity_hover }}; fill-opacity: {{ style.opacity_hover }};
} }

13
pygal/graph/graph.py

@ -104,17 +104,20 @@ class Graph(BaseGraph):
self.margin.left + self.view.width + 10, self.margin.left + self.view.width + 10,
self.margin.top + 10)) self.margin.top + 10))
for i, title in enumerate(self._legends): for i, title in enumerate(self._legends):
legend = self.svg.node(legends, class_='legend') legend = self.svg.node(
self.svg.node(legend, 'rect', legends, class_='legend reactive activate-serie',
id="activate-serie-%d" % i)
self.svg.node(
legend, 'rect',
x=0, x=0,
y=1.5 * i * self.legend_box_size, y=1.5 * i * self.legend_box_size,
width=self.legend_box_size, width=self.legend_box_size,
height=self.legend_box_size, height=self.legend_box_size,
class_="color-%d activate-serie reactive" % i, class_="color-%d reactive" % i
id="activate-serie-%d" % i
).text = title ).text = title
# Serious magical numbers here # Serious magical numbers here
self.svg.node(legend, 'text', self.svg.node(
legend, 'text',
x=self.legend_box_size + 5, x=self.legend_box_size + 5,
y=1.5 * i * self.legend_box_size y=1.5 * i * self.legend_box_size
+ .5 * self.legend_box_size + .5 * self.legend_box_size

Loading…
Cancel
Save