mirror of https://github.com/Kozea/pygal.git
Florian Mounier
13 years ago
5 changed files with 29 additions and 16 deletions
@ -1,14 +1,14 @@
|
||||
from pygal import Serie, Margin, Label |
||||
from pygal.line import Line |
||||
from pygal.style import LightStyle |
||||
from math import cos, sin |
||||
|
||||
|
||||
def test_simple_line(): |
||||
line = Line(800, 600) |
||||
line.add('test1', [cos(x / 10.) for x in range(-30, 30, 5)]) |
||||
line.add('test2', [sin(x / 10.) for x in range(-30, 30, 5)]) |
||||
line.add('test3', [cos(x / 10.) - sin(x / 10.) for x in range(-30, 30, 5)]) |
||||
line.x_labels = map(str, range(-30, 30, 5)) |
||||
# line.y_labels = [Label(str(lbl / 100.), lbl / 100.) for lbl in range(20)] |
||||
line = Line(800, 600, style=LightStyle, precision=2, format='f') |
||||
rng = range(-30, 30, 5) |
||||
line.add('test1', [cos(x / 10.) for x in rng]) |
||||
line.add('test2', [sin(x / 10.) for x in rng]) |
||||
line.add('test3', [cos(x / 10.) - sin(x / 10.) for x in rng]) |
||||
line.x_labels = map(str, rng) |
||||
line.title = "cos sin and cos - sin" |
||||
line._in_browser() |
||||
|
Loading…
Reference in new issue