Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Piecharts or donut charts using Dash?

Hi There:

I want to write code instead of using the GUI to create the charts.

So far I have dabbed my feet with Dash and when I tried to use some sample piechart code from Plotly, the graph gets generated on the plotly server whereas I want it to run on Dash.

Can someone point me to a sampler code for PieChart construction on Dash?

Also curious to know if there is a way to have Plotly send the piechart to Dash’s server instead of sending it to Plotly’s server.

some pieces of code to plot pie
in callback

return { ‘data’ : [go.Pie(labels=vid_spisok2,values=sbori2,
textinfo=‘none’ )], ‘layout’ : {‘title’ : title_text}

How can i read the labels and values from an xls into this instead of hard coding it in the script?

import pandas as pd

more info at

In Dash, graphs are generated entirely within the Dash app itself. Data is not sent to the servers.

I recommend that you get started by reading the dash tutorial: It takes a few hours but it’ll save you a lot of time in the long run.