'Changing text size of go Treemap for text inside sectors
I have been looking to increase to the size of the text contained in a graph object Treemap, but with no success. I tried inserting HTML line breaks in the actual text but that didn't work. Maybe I am missing a simple solution. The docs have textinfo, textposition but not text size. Here is what it currently looks like: I just want the text to be readable.
Thank for you help!
EDIT: Here is my current code:
fig = go.Figure(go.Treemap(
ids=df_treemap['id'].tolist(),
labels=df_treemap['labels'].tolist(),
parents=df_treemap['parent'].tolist(),
values=df_treemap['value'].tolist(),
branchvalues='total',
hovertemplate='<b>%{label}',
insidetextfont=dict(size=11),
textfont=dict(size=30),
marker=dict(
colors=df_treemap['color'],
colorscale='RdBu',
cmid=1,
showscale=True),
name='',
text=summaries,
I have tried cutting the text up with the following, but that does help: short_summaries = [textwrap.fill(df['Summary'].tolist()[0],10) if isinstance(df, pd.DataFrame) else 'N.A' for df in x]
Solution 1:[1]
Extracted from the official docs:
textfont – Sets the font used for textinfo.
And it has a size property.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | navylover |
