Skip to content

Commit c59bb69

Browse files
committed
📚 add scatter 3d example
1 parent c316277 commit c59bb69

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

docs/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
sphinxcontrib-spelling
2+
https://github.com/pyexcel/sphinxcontrib-excel/archive/master.zip
3+
https://github.com/pyexcel/pyexcel-handsontable/archive/master.zip

docs/source/_templates/layout.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<script src="_static/echarts-gl.js"></script>
1212
<script type="text/javascript" src="_static/china.js"></script>
1313
<script type="text/javascript" src="_static/world.js"></script>
14-
<script type="text/javascript" src="_static/wordcloud.js"></script>
14+
<script type="text/javascript" src="_static/echarts-wordcloud.min.js"></script>
1515
<script type="text/javascript" src="_static/anhui.js "></script>
1616
<script type="text/javascript" src="_static/aomen.js "></script>
1717
<script type="text/javascript" src="_static/beijing.js "></script>
@@ -34,7 +34,7 @@
3434
<script type="text/javascript" src="_static/neimenggu.js "></script>
3535
<script type="text/javascript" src="_static/ningxia.js "></script>
3636
<script type="text/javascript" src="_static/qinghai.js "></script>
37-
<script type="text/javascript" src="_static/shangdong.js "></script>
37+
<script type="text/javascript" src="_static/shandong.js "></script>
3838
<script type="text/javascript" src="_static/shanghai.js "></script>
3939
<script type="text/javascript" src="_static/shanxi.js "></script>
4040
<script type="text/javascript" src="_static/sichuan.js "></script>

docs/source/charts.rst

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,23 @@ Here is the source code using pyexcel
1313

1414
title = 'Browser usage in February 2012 (in %)'
1515
sheet = pyexcel.get_sheet(file_name='data/pie.csv')
16-
svg = sheet.plot(chart_type='pie', file_type='echarts.html',
17-
title=title, width=600, height=400, embed=True, legend_top='bottom')
16+
chart = sheet.plot(chart_type='pie', file_type='echarts.html',
17+
title=title, width=800, height=600, embed=True, legend_top='bottom')
18+
19+
20+
.. pyexcel-table:: data/scatter_3d.csv
21+
:width: 250
22+
:height: 300
23+
24+
Here is the source code using pyexcel
25+
26+
.. pyexcel-code::
27+
28+
title = 'Example scattered points in 3D'
29+
sheet = pyexcel.get_sheet(file_name='data/scatter_3d.csv')
30+
range_color = ['#313695', '#4575b4', '#74add1', '#abd9e9',
31+
'#e0f3f8', '#ffffbf',
32+
'#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']
33+
chart = sheet.plot(chart_type='scatter3d', file_type='echarts.html',
34+
visual_range_color=range_color, is_visualmap=True,
35+
title=title, width=800, height=600, embed=True, legend_top='bottom')

tests/test_echarts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ def test_radar_chart():
1414

1515

1616
def test_scatter3d_chart():
17+
1718
s = p.get_sheet(file_name=get_fixtures('scatter_3d.csv'))
1819
range_color = ['#313695', '#4575b4', '#74add1', '#abd9e9',
1920
'#e0f3f8', '#ffffbf',
2021
'#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']
2122
s.save_as('scatter3d.echarts.html', chart_type='scatter3d',
23+
is_visualmap=True,
2224
visual_range_color=range_color)

0 commit comments

Comments
 (0)