Skip to content

Create pie chart documentation tab #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions app/markdown/types-of-charts/pie-chart/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Pie Chart
## Introduction

A pie chart is a circular graphic divided into slices, with each slice representing a proportion of the whole.


Pie charts are especially useful for visualizing smaller datasets where understanding the relative proportions between categories is key. They excel at displaying categorical data in a way that emphasizes percentages or proportions, making it easy for viewers to quickly grasp scale and relative sizes.


With PureChart, you gain extensive styling flexibility for creating fully customized pie charts that fit seamlessly into your application’s design. Each chart also includes a corresponding legend that clearly lists the categories represented.


## Usage
Adding a pie chart is simple:

```erb
<%= pie_chart @data %>
```

Here's an example of some data you could pass in:

```rb
@data = [
{
name: "Dogs",
color: "blue",
value: 150
},
{
name: "Cats",
color: "purple",
value: 135
},
{
name: "Parrots",
color: "orange",
value: 70
},
]
```
And here is the corresponding chart: