mirror of https://github.com/Kozea/pygal.git
Florian Mounier
13 years ago
3 changed files with 26 additions and 11 deletions
@ -1,14 +1,20 @@ |
|||||||
from pygal.line import Line |
from pygal.line import Line |
||||||
from pygal.style import LightStyle |
|
||||||
from math import cos, sin |
from math import cos, sin |
||||||
|
|
||||||
|
|
||||||
def test_simple_line(): |
def test_simple_line(): |
||||||
line = Line(800, 600, style=LightStyle, precision=2, format='f') |
line = Line(800, 600, precision=2, format='f') |
||||||
rng = range(-30, 30, 5) |
rng = range(-30, 30, 5) |
||||||
line.add('test1', [cos(x / 10.) for x in rng]) |
line.add('test1', [cos(x / 10.) for x in rng]) |
||||||
line.add('test2', [sin(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.add('test3', [cos(x / 10.) - sin(x / 10.) for x in rng]) |
||||||
line.x_labels = map(str, rng) |
line.x_labels = map(str, rng) |
||||||
line.title = "cos sin and cos - sin" |
line.title = "cos sin and cos - sin" |
||||||
|
line.render() |
||||||
|
|
||||||
|
|
||||||
|
def test_one_dot(): |
||||||
|
line = Line(800, 600) |
||||||
|
line.add('one dot', [12]) |
||||||
|
line.x_labels = ['one'] |
||||||
line._in_browser() |
line._in_browser() |
||||||
|
Loading…
Reference in new issue