Is there a way to change plotly pie chart label arrow direction, they are pointing always straightup
like this one?
Is there a way to change plotly pie chart label arrow direction, they are pointing always straightup
like this one?
hi @goumang
Welcome to the Community. Thatβs a good question. I think your answer is the rotation
attribute, found on this page of the Figure reference docs.
Here is an example code:
import plotly.express as px
df = px.data.gapminder().query("year == 2007").query("continent == 'Europe'")
df.loc[df['pop'] < 2.e6, 'country'] = 'Other countries' # Represent only large countries
fig = px.pie(df, values='pop', names='country', title='Population of European continent')
fig.update_traces(rotation=180)
fig.show()