Browse Source

Added vertical lines connecting whiskers to main box

pull/91/head
Jeffrey Starr 11 years ago
parent
commit
bceba24629
  1. 10
      pygal/graph/box.py

10
pygal/graph/box.py

@ -110,6 +110,16 @@ class Box(Graph):
coords=[(left_edge, self.view.y(whisker)), (left_edge + width, self.view.y(whisker))], coords=[(left_edge, self.view.y(whisker)), (left_edge + width, self.view.y(whisker))],
attrib={'stroke-width': 3}) attrib={'stroke-width': 3})
# draw lines connecting whiskers to box (Q1 and Q3)
self.svg.line(parent_node,
coords=[(left_edge + width / 2, self.view.y(quartiles[0])),
(left_edge + width / 2, self.view.y(quartiles[1]))],
attrib={'stroke-width': 2})
self.svg.line(parent_node,
coords=[(left_edge + width / 2, self.view.y(quartiles[4])),
(left_edge + width / 2, self.view.y(quartiles[3]))],
attrib={'stroke-width': 2})
# box, bounded by Q1 and Q3 # box, bounded by Q1 and Q3
self.svg.node(parent_node, self.svg.node(parent_node,
tag='rect', tag='rect',

Loading…
Cancel
Save