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

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

problem about Pyecharts #93

Closed CCCCCecilia closed 6 years ago

CCCCCecilia commented 6 years ago

question 1: I draw a chart with Pyecharts. It can show in my Jupyter notebook, but cannot show when I use GitHub or https://nbviewer.jupyter.org to view it.

1542813440113 1542813694854

another question: how can I change the color and theme of charts to keep all the charts color harmonious?

hupili commented 6 years ago

question 1: I draw a chart with Pyecharts. It can show in my Jupyter notebook, but cannot show when I use GitHub or https://nbviewer.jupyter.org to view it.

Can you show the notebook link for our online testing? more

another question: how can I change the color and theme of charts to keep all the charts color harmonious?

Is this helpful? http://pyecharts.org/#/zh-cn/charts_style

CCCCCecilia commented 6 years ago

question 1: I draw a chart with Pyecharts. It can show in my Jupyter notebook, but cannot show when I use GitHub or https://nbviewer.jupyter.org to view it.

Can you show the notebook link for our online testing? more https://nbviewer.jupyter.org/github/CCCCCecilia/python-data-assignments/blob/master/assignment2/assignment2.ipynb

another question: how can I change the color and theme of charts to keep all the charts color harmonious?

Is this helpful? http://pyecharts.org/#/zh-cn/charts_style

hupili commented 6 years ago

For the pyecharts rendering problem, you can try the following steps:

  1. Save the chart to standalone HTML files.
  2. Use the from IPython.display import IFrame way to load it into your notebook.

Reference to the map in my recent open rice map visualisation

Please let us know if this works.

CCCCCecilia commented 6 years ago

For the pyecharts rendering problem, you can try the following steps:

  1. Save the chart to standalone HTML files.
  2. Use the from IPython.display import IFrame way to load it into your notebook.

Reference to the map in my recent open rice map visualisation

Please let us know if this works.

I tried this solution and it worked. Now the chart can show on nbviewer, but still cannot show on GitHub .

hupili commented 6 years ago

@CCCCCecilia can you show the working solution and help @ChicoXYC to merge into the FAQ? Thanks.

CCCCCecilia commented 6 years ago

@CCCCCecilia can you show the working solution and help @ChicoXYC to merge into the FAQ? Thanks.

OK.

ChicoXYC commented 6 years ago

merged into notes: https://github.com/hupili/python-for-data-and-media-communication-gitbook/blob/master/module-jupyter.md#display-charts-in-nbviwer