# Creating a chart from Excel

## Introduction

Since the Chart.js for Confluence app reads the information from tables, it is fairly simple to use an Excel table and copy it over to Confluence into a chart macro. Here is an example for a Bar Chart.

**1. Prepare the table in Excel**

<figure><img src="/files/qkPZBKWVVvLbr4Q1gXPl" alt=""><figcaption></figcaption></figure>

**2. Select and copy the table**

<figure><img src="/files/SDP6YJCYxieMvpyOA7Gz" alt=""><figcaption></figcaption></figure>

#### 3. Edit your Confluence page and insert a Chart.js Bar Chart macro

<figure><img src="/files/Ud0LydGcTDleOY2NPswk" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/QKrJD29hQoBXnShCtYu6" alt=""><figcaption></figcaption></figure>

#### 4. Paste the Excel table from the clipboard into the macro body

<figure><img src="/files/lb5Qyv6P7DFbqb0tJh57" alt=""><figcaption></figcaption></figure>

#### 5. Insert a 2nd and a 3rd column

The macro expects these two columns. They allow you to specify the type and color of the data series in each row.

<figure><img src="/files/RY3TEBgDnleNUfBQFcvE" alt=""><figcaption></figcaption></figure>

#### 6. Publish your page

At this point you can already publish your page. Even though you haven’t specified type and color. The macro will use defaults and random colors.

<figure><img src="/files/CdWmv3tMwKwibAzoOsBm" alt=""><figcaption></figcaption></figure>

#### 7. Edit your page again and fine tune your chart

You can go back to your macro and specify more details.

<figure><img src="/files/VoHqVuOYmlnChXADulCj" alt=""><figcaption></figcaption></figure>

#### 8. Final result after publish

<figure><img src="/files/vk2u4eBu3sL5qWwkZVrG" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lewe.gitbook.io/chartjs-for-confluence/creating-a-chart-from-excel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
