Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alignment problem #4537

Open
mic-user opened this issue Mar 3, 2024 · 5 comments
Open

Alignment problem #4537

mic-user opened this issue Mar 3, 2024 · 5 comments

Comments

@mic-user
Copy link

mic-user commented Mar 3, 2024

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()
@Coding-with-Adam
Copy link
Contributor

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,

@mic-user
Copy link
Author

mic-user commented Mar 8, 2024

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

@Coding-with-Adam
Copy link
Contributor

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

@mic-user
Copy link
Author

Reopen it.

@Coding-with-Adam
Copy link
Contributor

Bug reported in #6922

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants