8

Is it possible to create a single chart with a line series and a bar series?

chart = pygal.Line()
chart.x_labels = 'Red', 'Blue', 'Green'
chart.y_labels = .0001, .0003, .0004, .00045, .0005
chart.add('line', [.0002, .0005, .00035])
mechanical_meat
  • 163,903
  • 24
  • 228
  • 223
user_78361084
  • 3,538
  • 22
  • 85
  • 147

2 Answers2

1

In response to your query from pygal's github issue tracker: no

https://github.com/Kozea/pygal/issues/46

Chad Adams
  • 1,319
  • 1
  • 9
  • 14
1

An answer can be found in the documentation at http://www.pygal.org/en/stable/documentation/web.html.

<!DOCTYPE html>
<html>
  <head>
    <!-- ... -->
  </head>
  <body>
    <figure>
       <embed type="image/svg+xml" src="/mysvg.svg" />
    </figure>
  </body>
</html>

Duplicating the line in the <figure> tag allows you to vertically combine your charts, aligning at the left of the screen. With CSS, and defining two figure tags you can then align horizontally the two figures.

glihm
  • 1,138
  • 13
  • 29