plotly.py
plotly.py copied to clipboard
Alignment problem
Hi. Need help to custom treemap. How to align horizontal center for the parent container?
import plotly.express as px
_all_box_name : list = ['parent0', 'parent1<br>asdflkassadfsadfsadf', 'item0<br>100', 'item1<br>123']
_sector : list = ['', '', 'parent0', 'parent1<br>asdflkassadfsadfsadf']
_volume : list = [0, 0, 332, 532]
_labels : list = {'parent0' : 'parent0', 'parent1<br>asdflkassadfsadfsadf' : 'parent1', 'item0' : 'item0 111', 'item1' : 'item1222'}
fig = px.treemap(
parents = _sector,
names = _all_box_name,
values = _volume,
width = 1024,
height = 768,
labels = _labels
)
fig.update_traces(
textposition="middle center",
textfont_size=33
)
fig.update_layout(uniformtext_minsize=8, uniformtext_mode='hide')
fig.layout.hovermode = False
fig.data[0].texttemplate = "<b>%{label}</b>"
fig.show()
hi @mic-user, This is a question best asked on the Plotly forum. If you don't get a satisfying answer, please let me know.
Thank you,
@Coding-with-Adam It is issue of the plotly that not working. Focus on the contents of the sentence, not the nice tone and manner of the sentences. Plus, no one know the solution that impossilbe to archive since its over a month question on forum. https://community.plotly.com/t/plotly-treemap-question-for-font-alignment-of-parent-container/82185
Fix it.
hi @mic-user Thanks for sharing the link to the forum question. I'll look at it right now and respond there.
Reopen it.
Bug reported in #6922