Forum Discussion
Anonymous
5 years agoNot applicable
edit graph
I want to edit graph from pic1 to pic2 guide ma about it please. Pic 1 Pic2
Anonymous
5 years agoNot applicable
v-kkf-msft
5 years agoCommunity Support
Hi Anonymous ,
Use the following script in the Python visual.
import numpy as np
import matplotlib.pyplot as plt
y = dataset.ID
x1 = dataset.value1
x2 = dataset.value2
# Default Settings
b=plt.barh(y, x1,align="center",color="#66c2a5",label="value1")
b2=plt.barh(y, x2,align="center",left=x1,color="#8da0cb",label="value2")
for rect in b:
w = rect.get_width()
plt.text(w-0.05, rect.get_y()+rect.get_height()/2, '{:.0%}'.format(w), ha='left', va='center',fontsize=20)
plt.xticks([0.05, 0.5,0.9, 1],['$on process$', '$continue$', '$On the way$','$Completed$'])
plt.grid(axis="x", which="major",linestyle='-.')
plt.title('custom')
plt.xlabel('xlabel name')
plt.ylabel('ylabel name')
plt.legend()
plt.show()
This is my PBIX file.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.