Create Hand Drawn Charts In Excel Using Python (Fast & Easy) | Cutecharts Tutorial 📊
Language:
In this tutorial, I will show you how you can create hand-drawn / comic-style charts from an Excel file using the Python library cutecharts.
from cutecharts.charts import Line from cutecharts.charts import Bar from cutecharts.charts import Pie import pandas as pd ### LINE CHART ### # Load Data: Get data from Excel using pandas line_df = pd.read_excel('data.xlsx', sheet_name='Line') x = line_df['Month'].to_list() y1 = line_df['Sales'].to_list() y2 = line_df['Profit'].to_list() # Create Line Chart chart = Line('Sales & Profit') chart.set_options( labels=x, x_label='Months', y_label='USD' ) chart.add_series('Sales', y1) chart.add_series('Profit', y2) chart.render('line.html') ### BAR CHART ### # Load Data bar_df = pd.read_excel('data.xlsx', sheet_name='Bar') x = bar_df['Sub Category'].to_list() y = bar_df['Sales'].to_list() # Create Chart chart = Bar('Sales by Sub Category') chart.set_options( labels=x, x_label='Category', y_label='Sales in USD', # colors=['#FFF1C9','#F7B7A3','#EA5F89','#9B3192','#57167E','#47B39C','#00529B'] ) chart.add_series('Sales', y) chart.render('bar.html') ### Pie/Donut CHART ### # Load Data pie_df = pd.read_excel('data.xlsx', sheet_name='Pie') x = pie_df['Category'].to_list() y = pie_df['Sales'].to_list() # Create Chart chart = Pie('Sales by Category') chart.set_options( labels=x, inner_radius=0 ) chart.add_series(y) chart.render('pie.html')