7
7
ROOT = os.path.dirname(os.path.abspath(__file__))
8
8
sys.path.insert(0, os.path.join(ROOT, '..'))
10
from pygooglechart import Chart
10
11
from pygooglechart import SimpleLineChart
11
12
from pygooglechart import XYLineChart
12
13
from pygooglechart import SparkLineChart
96
97
chart.download('line-fill.png')
101
# Set the vertical range from 0 to 100
104
# Chart size of 200x125 pixels and specifying the range for the Y axis
105
chart = SimpleLineChart(200, 125, y_range=[0, max_y])
109
32, 34, 34, 32, 34, 34, 32, 32, 32, 34, 34, 32, 29, 29, 34, 34, 34, 37,
110
37, 39, 42, 47, 50, 54, 57, 60, 60, 60, 60, 60, 60, 60, 62, 62, 60, 55,
111
55, 52, 47, 44, 44, 40, 40, 37, 34, 34, 32, 32, 32, 31, 32
115
# Set the line colour to blue
116
chart.set_colours(['0000FF'])
118
# Set the vertical stripes
119
chart.fill_linear_stripes(Chart.CHART, 0, 'CCCCCC', 0.2, 'FFFFFF', 0.2)
121
# Set the horizonal dotted lines
122
chart.set_grid(0, 25, 5, 5)
124
# The Y axis labels contains 0 to 100 skipping every 25, but remove the
125
# first number because it's obvious and gets in the way of the first X
127
left_axis = range(0, max_y + 1, 25)
129
chart.set_axis_labels(Axis.LEFT, left_axis)
132
chart.set_axis_labels(Axis.BOTTOM, \
133
['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'])
135
chart.download('line-stripes.png')