Skip to content

Commit 5c27098

Browse files
committed
Add pie/donut charts to examples, ipynb, readme, and docs
1 parent d3f1cc7 commit 5c27098

27 files changed

+1134
-82
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,23 @@ group.colors(brew='Set2')
142142
```
143143
![groupbar2](http://farm6.staticflickr.com/5518/9391272912_706055754a_o.jpg)
144144

145+
Pie charts:
146+
147+
```python
148+
vis = vincent.Pie(farm_1)
149+
vis.legend('Farm 1 Fruit')
150+
```
151+
![pie](http://farm4.staticflickr.com/3684/11391908745_2837f1bb9a.jpg)
152+
153+
Donut charts:
154+
155+
```
156+
vis = vincent.Pie(farm_1, inner_radius=200)
157+
vis.colors(brew="Set2")
158+
vis.legend('Farm 1 Fruit')
159+
```
160+
![donut](http://farm6.staticflickr.com/5530/11391917226_598fbdf3e2.jpg)
161+
145162
Simple maps can be built quickly (all data can be found in the [vincent_map_data](https://github.com/wrobstory/vincent_map_data) repo):
146163

147164
```python
@@ -334,13 +351,13 @@ Huge thanks to all who have contributed to Vincent development:
334351
* Rob Story (wrobstory)
335352
* Dan Miller (dnmiller)
336353
* Peter Lubell-Doughtie (pld)
354+
* Lx Yu (lxyu)
337355
* Damien Garaud (garaud)
338356
* Abraham Flaxman (aflaxman)
339357
* Mahdi Yusuf (myusuf3)
340358
* Richard Maisano (maisano)
341359
* Julian Berman (Julian)
342360
* Chris Rebert (cvrebert)
343-
* Lx Yu (lxyu)
344361
* Wojciech Bederski (wuub)
345362
* Min RK (minrk)
346363
* Drazen Lucanin (kermit666)
2.21 KB
Binary file not shown.

doc/build/doctrees/environment.pickle

881 Bytes
Binary file not shown.

doc/build/doctrees/quickstart.doctree

1.06 KB
Binary file not shown.

doc/build/doctrees/vega_api.doctree

-685 Bytes
Binary file not shown.

doc/build/html/.buildinfo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 1825ee24304a60009a54edfcf4b4193b
4-
tags: 645f666f9bcd5a90fca523b33c5a78b7
3+
config: 31ac93b6d6a45684f9fd7ee3765dc6bc
4+
tags: a205e9ed8462ae86fdd2f73488852ba9

doc/build/html/_sources/charts_library.txt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Multiple lines can also be plotted easily::
8282
multi_iter1 = {'index': index}
8383
for cat in cats:
8484
multi_iter1[cat] = [random.randint(10, 100) for x in index]
85-
lines = vincent.Line(data, iter_idx='index')
85+
lines = vincent.Line(multi_iter1, iter_idx='index')
8686
lines.legend(title='Categories')
8787
lines.axis_titles(x='Index', y='Data Value')
8888

@@ -197,6 +197,26 @@ Currently grouped sets only work with Pandas DataFrames, but that should change
197197

198198
.. image:: /images/grouped_bar2.png
199199

200+
.. _chart_lib_pie:
201+
202+
Pie/Donut Chart
203+
---------------
204+
205+
Pie chart outer radius defaults to 1/2 min(width/height)::
206+
207+
pie = vincent.Pie(farm_1)
208+
pie.legend('Farm 1 Fruit')
209+
210+
.. image:: /images/pie_0.png
211+
212+
Donut charts can be created by passing an inner radius::
213+
214+
donut = vincent.Pie(farm_1, inner_radius=500)
215+
donut.colors(brew="Set2")
216+
donut.legend('Farm 1 Fruit')
217+
218+
.. image:: /images/donut_0.png
219+
200220
.. _chart_lib_simple_map:
201221

202222
Simple Map

doc/build/html/_sources/quickstart.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ Labeling the axes is simple::
2929

3030
.. image:: /images/quick_bar2.png
3131

32+
You can also control aspects of the layout::
33+
34+
import vincent
35+
from vincent import AxisProperties, PropertySet, ValueRef
36+
bar = vincent.Bar(multi_iter1['y1'])
37+
bar.axis_titles(x='Index', y='Value')
38+
#rotate x axis labels
39+
ax = AxisProperties(
40+
labels = PropertySet(angle=ValueRef(value=90)))
41+
bar.axes[0].properties = ax
42+
43+
.. image:: /images/quick_bar3.png
44+
45+
46+
3247
.. _quick_line:
3348

3449
Line

doc/build/html/_static/jquery.js

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/build/html/building_vega.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
<li class="toctree-l2"><a class="reference internal" href="charts_library.html#stacked-area">Stacked Area</a></li>
9494
<li class="toctree-l2"><a class="reference internal" href="charts_library.html#stacked-bar">Stacked Bar</a></li>
9595
<li class="toctree-l2"><a class="reference internal" href="charts_library.html#grouped-bar">Grouped Bar</a></li>
96+
<li class="toctree-l2"><a class="reference internal" href="charts_library.html#pie-donut-chart">Pie/Donut Chart</a></li>
9697
<li class="toctree-l2"><a class="reference internal" href="charts_library.html#simple-map">Simple Map</a></li>
9798
<li class="toctree-l2"><a class="reference internal" href="charts_library.html#map-data-binding">Map Data Binding</a></li>
9899
</ul>
@@ -406,7 +407,7 @@ <h2>Data Importing<a class="headerlink" href="#data-importing" title="Permalink
406407
</p>
407408
<p>
408409
&copy; Copyright 2013, Rob Story, Dan Miller, et. al..<br/>
409-
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.2b2.<br/>
410+
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.2b1.<br/>
410411
</p>
411412
</div>
412413
</footer>

0 commit comments

Comments
 (0)