Open Graceyit opened 5 years ago
@Graceyit has your problem solved?
The code is not reproducible. @ChicoXYC , please try to get the data that produces this case. Without content loaded in df
or tf
, the chart can not be reproduced. After that, please check if my link solves the issue. Let me know if that still doesn't work
I am really sorry that I reply you so late. And I have tried again the code you gave me but I do not know if I am right.It seems that the problem doesn't be solve.
@Graceyit can you provide the following information?
df
using df.to_csv
and then upload the file here (drag and drop to the issue comment box)It also works if you can link to your project repo where we can find this data file.
OK pili, here is the code
from pyecharts import Bar
tf=df.groupby(['title'])['favorite'].mean().reset_index().sort_values("favorite",ascending=False)[:15]
tt=df.groupby(['title'])['thumb'].mean().reset_index().sort_values("thumb",ascending=False)[:15]
attr=tf.title
v1=tf.favorite
v2=tt.thumb
bar=Bar('article by favorite and thumb')
bar.add('by favorite',attr,v1,xaxis_interval=0, xaxis_rotate=30,mark_line=['average'])
bar.add('by thumb',attr,v2,xaxis_interval=0, xaxis_rotate=30,mark_line=['average'])
bar
but I didn't put this code in the final project https://github.com/Graceyit/BigData-Final-Project-woshipm.com/blob/master/Data%20analysis%20P1/Data%20Analysis%20P1.ipynb
And this link is the data file. https://github.com/Graceyit/BigData-Final-Project-woshipm.com/blob/master/Data%20analysis%20P2/haha.csv
After I tried some methods, Still cannot solve the problem.
I think its the problem of pyecharts, they set the fixed size of text label margin of the charts. And give no option/parameters to change by users. https://nbviewer.jupyter.org/github/ChicoXYC/exercise/blob/master/py-echarts/pyecharts-text%20label.ipynb
Troubleshooting
Describe your environment
Describe your question
The words at the bottom were blocked.
The minimum code (snippet) to reproduce the issue
Describe the efforts you have spent on this issue
What is the closest answer you can find?
grid: { x: 100,y2: 200 }