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
- Enter the data in the form fields provided.
- Click on the "Generate Chart" button to view the pie chart.
Input Values
- Label Column: This is the column in your data set that contains the labels for each category.
- Value Column: This is the column in your data set that contains the values for each category.
Output Values
- 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
- The function takes input data in the form of a table with columns for labels and values.
- It extracts the label and value columns from the input data.
- It creates a pie chart using the extracted label and value data.
- 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.