plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Alignment problem

Open mic-user opened this issue 1 year ago • 5 comments

Hi. Need help to custom treemap. How to align horizontal center for the parent container?

cbcb24a372716eaddb8866d21f902f095ab42e36

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()

mic-user avatar Mar 03 '24 12:03 mic-user

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 avatar Mar 08 '24 20:03 Coding-with-Adam

@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.

mic-user avatar Mar 08 '24 22:03 mic-user

hi @mic-user Thanks for sharing the link to the forum question. I'll look at it right now and respond there.

Coding-with-Adam avatar Mar 12 '24 16:03 Coding-with-Adam

Reopen it.

mic-user avatar Mar 13 '24 22:03 mic-user

Bug reported in #6922

Coding-with-Adam avatar Mar 14 '24 14:03 Coding-with-Adam