Simple Pie Chart based on Tabular Data (pie2_chart)

Create a pie chart to visualize tabular data on month-wise temperature. Customize labels and values with percentage and shadow options.

Simple Pie Chart based on Tabular Data

Purpose

The purpose of this function is to generate a simple pie chart based on tabular data provided by the user. The pie chart visually represents the distribution of values in the data set.

Use Cases

  • Visualizing the distribution of data in a tabular format.
  • Comparing the proportions of different categories in the data set.

How to Use

  1. Enter the data in the form fields provided.
  2. Click on the "Generate Chart" button to view the pie chart.

Input Values

  1. Label Column: This is the column in your data set that contains the labels for each category.
  2. Value Column: This is the column in your data set that contains the values for each category.

Output Values

  1. Chart: The generated pie chart displaying the distribution of values in the data set.

Any other Instruction

  • Make sure to enter the correct column names for the label and value columns.
  • You can hover over the sections of the pie chart to view the exact value of each category.

Code Analysis

  1. The function takes input data in the form of a table with columns for labels and values.
  2. It extracts the label and value columns from the input data.
  3. It creates a pie chart using the extracted label and value data.
  4. The function returns the generated pie chart.

Technical Parameters

  • data, title, show_pct, shadow, label_column, value_column

Return Values

  • chart

Example Expressions

You can use the following expressions to directly evaluate in a non-interactive manner using eval():

pie2_chart(data=pd.DataFrame({"label": ['Category A', 'Category B', 'Category C'], "value": ['30', '20', '50']}), title='Distribution of Categories', show_pct=True)
pie2_chart(data=pd.DataFrame({"label": ['Apple', 'Banana', 'Orange'], "value": ['25', '35', '40']}), title='Fruit Distribution', show_pct=False)

Click on Help icon to open the help page on a separate window.


label value
Jan 12
Feb 14
Mar 16
Apr 21
May 24
Jun 30
Jul 35
Aug 28
Sep 24
Oct 21
Nov 18
Dec 13




Calculator: pie2_chart, Created by: super, V#0: , Variant owner: , Link