hupili / python-for-data-and-media-communication-gitbook

An open source book on Python tailed for communication students with zero background
117 stars 62 forks source link

No error, but the pyecharts map can't display #131

Closed AlexZenghuashan closed 5 years ago

AlexZenghuashan commented 5 years ago

Troubleshooting

Describe your environment

Describe your question

No error, but the pyecharts map can't display. image I have already install the maps. image

The minimum code (snippet) to reproduce the issue

import pyecharts from pyecharts import Map value = [5, 2, 2, 2, 1, 1, 1, 5, 5] attr = ["深圳", "广州", "杭州", "成都", "南京", "厦门", "武汉", "北京", "上海"]
map = Map("Map 结合 VisualMap 示例", width=1200, height=600) map.add( "", attr, value, maptype="china", is_visualmap=True, visual_text_color="#000", ) map.render() map Example:

open('path-to-a-file-not-exist')

Describe the efforts you have spent on this issue

Example:

Have you Google/ Stackover flow anything?

Do they solve or partially solve your question?

What is the closest answer you can find?

ChicoXYC commented 5 years ago

@AlexZenghuashan

bar.render() will generate a html in your local computer, you may need to use IFrame to display the charts, the solutions are https://github.com/hupili/python-for-data-and-media-communication-gitbook/blob/master/module-jupyter.md#import-interactive-charts-in-jupyter-notebook

ChicoXYC commented 5 years ago

@AlexZenghuashan does the solution above solved your problem?

AlexZenghuashan commented 5 years ago

Yes, the solution has solved my problem. Thank you!