# QuickChart

Welcome to the **QuickChart Mini App** on Rapidbott! This app allows you to generate visual charts and diagrams using the [QuickChart API](https://quickchart.io). Use it to quickly turn your data into powerful visualizations, including bar charts, flowcharts, and more.

### 🛠️ Installation Guide

To install the QuickChart Mini App in your Rapidbott workspace:

1. Go to your **Rapidbott Dashboard**.
2. From the left side panel, click **Mini Apps**.
3. Click **Install Mini App**.
4. In the search bar, type **QuickChart**.
5. Select **QuickChart** from the results.
6. Click **Install** to add it to your workspace.
7. An **active S3 storage** setup in your workspace → [How to set up S3 storage](https://youtu.be/JGVSH-mCTjs?si=1QRg1wd0jVwXtbbo)

Once installed, you can access its actions under the **Actions** tab.

### ⚙️ Available Actions

#### 1. 🧩 `create_chart_with_function`

**Title:** Create Advanced Chart (Multiple Datasets)\
**Description:**\
Use this action to generate advanced charts that support **multiple datasets**, **value suffixes**, and **smart formatting**. Ideal for comparing multiple data series like Revenue vs Profit.

**Input Format Example:**

```json
{
  "type": "bar",
  "labels": "Q1, Q2, Q3, Q4",
  "datasets": [
    { "label": "Revenue", "data": "400, 500, 100, 800" },
    { "label": "Profit", "data": "200, 300, 50, 600" }
  ],
  "options": {
    "suffix": "₹",
    "title": "Quarterly Performance"
  }
}
```

**Notes:**

* `labels` accepts comma or space-separated values.
* `data` inside each dataset must match the number of labels.
* Optional `options` field can include `suffix`, `title`, `color`, `legend` etc.

***

#### 2. 🔁 `create_graphViz_charts`

Create a GraphViz Diagram\
\
This action uses [GraphViz](https://graphviz.org/) syntax to create flowcharts and diagrams based on **node relationships**.

**Input Format Example:**

```
A -> B;
B -> C;
C -> D;
```

This will generate a directional flowchart from A to D.

### API parameters <a href="#api-parameters" id="api-parameters"></a>

The `https://quickchart.io/graphviz` endpoint supports HTTP GET requests with the following parameters:

* **graph** - the DOT graph description (required)
* **layout** - the name of the graph layout engine (default `dot`)
* **format** - the output format, either png or svg (default `svg`)
* **width** - width of image, applicable to png only (defaults to fit)
* **height** - height of image, applicable to png only (defaults to fit)

The API also supports HTTP POST requests with JSON payloads. Here's an example payload:

```
{
  "graph": "digraph {a->b}",
  "layout": "dot",
  "format": "svg"
}
```

**Tips:**

* Use `->` to define connections.
* Each statement must end with `;`
* Optionally wrap the whole input in `digraph { ... }`, or the Mini App will do it automatically.

***

#### 3. 📊 `create_simple_chart`

Create Simple Chart\
\
Use this action to generate a single dataset chart like a basic bar or line chart from user input.

**Input Format Example:**

```json
{
  "type": "bar",
  "labels": "Q1 Q2 Q3 Q4",
  "datasetLabel": "Revenue",
  "data": "400 500 100 800"
}
```

**Supported Fixes:**

* Accepts `labels` and `data` in both comma `,` or space separated format.
* Automatically capitalizes and formats label text.
* Returns a QuickChart image URL.

***

### 🧠 General Input Guidelines

* `labels` should be the same count as each `data` array.
* Capitalization and spacing are automatically cleaned.
* Numbers should be valid integers or floats, separated by space or comma.
* GraphViz inputs must use `->` arrows and semicolons.

***

### 📎 Output Format

Each action will return:

* A valid QuickChart-compatible **JSON object** (for chart actions), or
* A **chart image URL** that can be directly used or shared.

***

### 💳 API Usage Notes

All chart generation is powered by [QuickChart.io](https://quickchart.io). Please be aware of their rate limits and usage policy, especially if you're on the free plan.

***

### ❓Need Help?

If you encounter issues or need help formatting your input:

* Refer to QuickChart Documentation
* Or contact **Rapidbott Support**
