I want the values to be displayed in pie chart instead of the percentages, there is no property to display the numbers instead of the percentages. Please suggest.
Sample code to generate the pie chart:
import plotly.express as px
import pandas as pd
def my_view(request):
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file)))
a=os.path.join(BASE_DIR, ‘db.sqlite3’)
con = sqlite3.connect(a)
cur = con.cursor()
df = pd.read_sql_query(“SELECT * from POL”, con)
esd = df.groupby(‘ProjectStatus’, as_index=False).agg({“ProjectID”: “count”})
fig = px.pie(esd, values=Tasks, names=my_labels, color_discrete_sequence=px.colors.sequential.Blugrn)
graph = fig.to_html(full_html=False, default_height=350, default_width=500)
context = {‘graph’: graph}
response = render(request, ‘Home.html’, context)