@@ -29,22 +29,55 @@ <h2>Line Chart</h2>
2929
3030 {{ line_chart.as_html }}
3131 < pre class ="code ">
32+ queryset = Account.objects.all()
3233 data_source = ModelDataSource(queryset, fields=['year', 'sales',],)
33- gchart.LineChart(data_source, options={'title': "Sales Growth"})
34+ chart = yui.LineChart(data_source, options={'title': "Sales Growth"})
35+ </ pre >
36+ </ div >
37+ < br />
38+
39+ < h2 > Spline Chart</ h2 >
40+ < div id ="spline_chart " class ="well ">
41+
42+ {{ spline_chart.as_html }}
43+ < pre class ="code ">
44+ data = [
45+ ['Year', 'Sales', 'Expenses', 'Items Sold', 'Net Profit'],
46+ ['2004', 1000, 400, 100, 600],
47+ ['2005', 1170, 460, 120, 310],
48+ ['2006', 660, 1120, 50, -460],
49+ ['2007', 1030, 540, 100, 200],
50+ ]
51+ data_source = SimpleDataSource(data)
52+ chart = yui.SplineChart(data_source, options={'title': "Sales/ Expense"})
3453 </ pre >
3554 </ div >
3655 < br />
3756
3857 < h2 > Column Chart</ h2 >
3958 < div id ="column_chart " class ="well ">
4059 {{ column_chart.as_html }}
60+ < pre class ="code ">
61+ data = [
62+ ['Year', 'Sales', 'Expenses', 'Items Sold', 'Net Profit'],
63+ ['2004', 1000, 400, 100, 600],
64+ ['2005', 1170, 460, 120, 310],
65+ ['2006', 660, 1120, 50, -460],
66+ ['2007', 1030, 540, 100, 200],
67+ ]
68+ data_source = SimpleDataSource(data)
69+ chart = yui.ColumnChart(data_source, options={'title': "Sales/ Expense"})
4170 </ div >
4271
4372 < br />
4473
4574 < h2 > Bar Chart</ h2 >
4675 < div id ="bar_chart " class ="well ">
4776 {{ bar_chart.as_html }}
77+ < pre class ="code ">
78+ data_source = ModelDataSource(queryset, fields=['year', 'sales'])
79+ chart = yui.BarChart(data_source, options={'title': "Expense Growth"})
80+ </ pre >
4881 </ div >
4982 < br />
5083
@@ -56,6 +89,28 @@ <h2>Candlestick Chart</h2>
5689 < h2 > Pie Chart</ h2 >
5790 < div id ="pie_chart " class ="well ">
5891 {{ pie_chart.as_html }}
92+ < pre class ="code ">
93+ data_source = ModelDataSource(queryset, fields=['year', 'sales'])
94+ chart = yui.PieChart(data_source)
95+ </ pre >
96+ </ div >
97+
98+ < h2 > Area Chart</ h2 >
99+ < div id ="area_chart " class ="well ">
100+ {{ area_chart.as_html }}
101+ < pre class ="code ">
102+ data_source = ModelDataSource(queryset, fields=['year', 'sales'])
103+ chart = yui.AreaChart(data_source)
104+ </ pre >
105+ </ div >
106+
107+ < h2 > Areaspline Chart</ h2 >
108+ < div id ="area_spline_chart " class ="well ">
109+ {{ area_spline_chart.as_html }}
110+ < pre class ="code ">
111+ data_source = ModelDataSource(queryset, fields=['year', 'sales'])
112+ chart = yui.AreaSplineChart(data_source)
113+ </ pre >
59114 </ div >
60115
61116{% endblock %}
0 commit comments