Back to Browse

How To Create A Pie Chart In Python Using Plotly & Excel | Tutorial [EASY] ๐Ÿ’ป

14.0K views
Aug 23, 2020
6:51

๐Ÿ‘‰ Explore All My Excel Solutions: https://pythonandvba.com/solutions ๐——๐—˜๐—ฆ๐—–๐—ฅ๐—œ๐—ฃ๐—ง๐—œ๐—ข๐—ก โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ Did you know you can use Python code to create a pie chart? This is a tutorial that will show you how to create one using Python. For this particular tutorial, we will be using Plotly & Excel. You can do all the changes in the excel file and after running the script again you will have your updated pie chart. The Pie Chart is also interactive. If you hover over the chart, you will see the percent share for each category and you can even hide/unhide certain categories dynamically. The final chart will be also saved in a HTML file. Hence, you could also send the chart to your friends & colleagues, who do not even need to have Python installed on their machines. This tutorial is focusing on beginners in Python. Even you have never written a single line of code in Python, you will be able to have your pie chart by the end of this tutorial. โœ… Chapters: 0:00 Demo 0:45 Tutorial 6:30 Outro Source code incl. Excel file: https://github.com/Sven-Bo/python-simple-pie-chart =================================================== ๐Ÿ‘ฉโ€๐Ÿ’ป SOURCE CODE: import plotly.express as px import pandas as pd import plotly # Read data from excel df = pd.read_excel('data.xlsx') values = df['Results'] names = df['Category'] fig = px.pie(df, values=values, names=names, title='Survey Results' ) fig.update_traces( textposition='inside', textinfo='percent+label' ) fig.update_layout( title_font_size = 42, ) # Export Waterfall to HTML plotly.offline.plot(fig,filename='Piechart.html') ๐—ง๐—ข๐—ข๐—Ÿ๐—ฆ ๐—”๐—ก๐—— ๐—ฅ๐—˜๐—ฆ๐—ข๐—จ๐—ฅ๐—–๐—˜๐—ฆ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ ๐Ÿ†“ใ€๐—™๐—ฅ๐—˜๐—˜ใ€‘Excel Add-in (๐— ๐˜†๐—ง๐—ผ๐—ผ๐—น๐—•๐—ฒ๐—น๐˜): https://pythonandvba.com/mytoolbelt ๐Ÿ“Š Dashboard Excel Add-In (๐—š๐—ฟ๐—ฎ๐—ณ๐—น๐˜†): https://pythonandvba.com/grafly ๐ŸŽจ Cartoon Charts Excel Add-In (๐—–๐˜‚๐˜๐—ฒ๐—ฃ๐—น๐—ผ๐˜๐˜€): https://pythonandvba.com/cuteplots ๐Ÿคช Fun Emoji Excel Add-In (๐—˜๐—บ๐—ผ๐—ท๐—ถ๐—ณ๐˜†): https://pythonandvba.com/emojify ๐Ÿ“‘ Excel Templates: https://pythonandvba.com/go/excel-templates ๐ŸŽ“ My Courses: https://pythonandvba.com/go/courses ๐Ÿ“š Books, Tools, and More: https://pythonandvba.com/resources ๐—–๐—ข๐—ก๐—ก๐—˜๐—–๐—ง ๐—ช๐—œ๐—ง๐—› ๐— ๐—˜ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ ๐Ÿ”— LinkedIn: https://www.linkedin.com/in/sven-bosau/ ๐Ÿ“ธ Instagram: https://instagram.com/codingisfun_official ๐Ÿ’ป GitHub: https://github.com/Sven-Bo ๐Ÿ’ฌ Discord: https://pythonandvba.com/discord ๐Ÿ“ฌ Contact: https://pythonandvba.com/contact โ˜• ๐—•๐˜‚๐˜† ๐—บ๐—ฒ ๐—ฎ ๐—ฐ๐—ผ๐—ณ๐—ณ๐—ฒ๐—ฒ? If you want to support this channel, you can buy me a coffee here: https://pythonandvba.com/coffee-donation

Download

1 formats

Video Formats

360pmp410.4 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

How To Create A Pie Chart In Python Using Plotly & Excel | Tutorial [EASY] ๐Ÿ’ป | NatokHD