# Charts & Diagrams

Using [fields-html-support](https://docs.documentero.com/documentation/templates/fields-html-support "mention") or [fields-mermaid-support](https://docs.documentero.com/documentation/templates/fields-mermaid-support "mention") you can add simple and complex charts, diagrams and other elements based on data passed during document generation.

**Check Mermaid Tutorials & Syntax** -<https://mermaid.js.org/ecosystem/tutorials.html>

**Pie Chart**

```
pie title Pets adopted by volunteers
    "Dogs" : 386
    "Cats" : 85
    "Rats" : 15
```

<figure><img src="https://1713720388-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRMYKAUZ0NsaDRvNONC3%2Fuploads%2FBgbDdp5V6l9I9twCPbY2%2Fimage.png?alt=media&#x26;token=b4cd6081-4379-4ebd-aaed-b12885f7c6f0" alt="" width="375"><figcaption></figcaption></figure>

**Sequence Diagram Example**

```
sequenceDiagram
    Alice->>John: Hello John, how are you?
    John-->>Alice: Great!
    Alice-)John: See you later!
```

<figure><img src="https://1713720388-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRMYKAUZ0NsaDRvNONC3%2Fuploads%2FoC2VfhUftnaJ0In6BIUm%2Fimage.png?alt=media&#x26;token=f766eeb1-4eb8-4f7e-a48b-c9fa5604348f" alt="" width="375"><figcaption></figcaption></figure>

#### Chart XY

```
---
config:
    xyChart:
        width: 900
        height: 600
    themeVariables:
        xyChart:
            titleColor: "#ff0000"
---
xychart-beta
    title "Sales Revenue"
    x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
    y-axis "Revenue (in $)" 4000 --> 11000
    bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
    line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
```

<figure><img src="https://1713720388-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRMYKAUZ0NsaDRvNONC3%2Fuploads%2FgliC7tUMIa9EuuG8NT0i%2Fimage.png?alt=media&#x26;token=47513fd1-d6fe-4514-a99d-40f1490bec1a" alt="" width="375"><figcaption></figcaption></figure>

**Check more examples on Mermaid official documentation site** -<https://mermaid.js.org/ecosystem/tutorials.html>


---

# 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://docs.documentero.com/documentation/charts-and-diagrams.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.
