# Plotly express sunburst - print text from sector of chart

**URL:** <https://community.plotly.com/t/plotly-express-sunburst-print-text-from-sector-of-chart/62162>\
**Category:** 📊 Plotly Python\
**Tags:** tips-and-tricks, question\
**Created:** [March 22, 2022, 2:16pm UTC](https://community.plotly.com/t/plotly-express-sunburst-print-text-from-sector-of-chart/62162 "2022-03-22T14:16:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sinhurry](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/sinhurry/32/18507_2.png) [@sinhurry](https://community.plotly.com/u/sinhurry)\
**Post date:** [March 22, 2022, 2:16pm UTC](https://community.plotly.com/t/plotly-express-sunburst-print-text-from-sector-of-chart/62162/1 "2022-03-22T14:16:11Z")

</div>

I am using the below code to generate a pie chart.

What is required is that when one clicks on a sector of the chart, print the name where  
the mouse is clicked?

```auto
import plotly.express as px

df = px.data.tips()

fig = px.sunburst(df, path=['day', 'sex'],
				values='total_bill')
fig.show()

```

this is a sample code. But it explains the requirement. Hope I have explained my self clearly.

Thank you
