Skip to content

Sunburst plots override font size and don't position unreadable labels outside #2029

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

Open
johentsch opened this issue Jan 4, 2020 · 3 comments
Labels
bug something broken P3 backlog

Comments

@johentsch
Copy link

Hi everyone,

just discovered sunburst plots and am loving them! Besides the problem of text orientation that is momentarily being solved, I am wondering why it is possible to style outsidetextfont but not possible to actually place text outside the chart (at least for the last level). Similarly to pie charts, I would expect to find a textposition = 'outside' parameter. At the moment, for tiny wedges, the labels are being squeezed in no matter what, ignoring the font sizes given in insidetextfont AND textfont. Example:

import plotly.graph_objects as go
data = pd.DataFrame.from_dict({'key': {0: '#iii',
  1: '#vi',
  2: 'I',
  3: 'III',
  4: 'V',
  5: 'bII',
  6: 'i',
  7: 'ii',
  8: 'iii',
  9: 'iv',
  10: 'v',
  11: 'major',
  12: 'minor'},
 'duration': {0: 4.0,
  1: 12.0,
  2: 85.0,
  3: 202.0,
  4: 4.0,
  5: 4.5,
  6: 655.0,
  7: 5.0,
  8: 4.0,
  9: 33.5,
  10: 54.5,
  11: 295.5,
  12: 768.0},
 'parent': {0: 'minor',
  1: 'minor',
  2: 'major',
  3: 'major',
  4: 'major',
  5: 'major',
  6: 'minor',
  7: 'minor',
  8: 'minor',
  9: 'minor',
  10: 'minor',
  11: '',
  12: ''}})
fig =go.Figure(go.Sunburst(
    labels=data.key,
    parents=data.parent,
    values=data.duration,
    branchvalues="total", 
    textfont = {'size': 20},
    insidetextfont = {'size': 20},
    textinfo = "label+percent parent",
    #textposition='outside' <-- this option is missing
    ))
fig.show()

sunburst

@johentsch johentsch changed the title Sunburst plots don't position unreadable labels outside and override font size Sunburst plots override font size and don't position unreadable labels outside Jan 4, 2020
@maldil
Copy link

maldil commented Dec 7, 2020

Is there any workaround to place the text outside the chart? @nicolaskruchten

@maxrossi
Copy link

maxrossi commented May 2, 2023

Any news about this?

@madeofstardust
Copy link

Any news?

@gvwilson gvwilson self-assigned this Jul 8, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added P3 backlog bug something broken labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

No branches or pull requests

5 participants