---
title: "Bar ViewHelper <c:chart.bar>"
manual: "SAV Charts"
version: "14.7"
source: "Reference/FluidParserViewHelpers/Chart/BarViewHelper/Index.rst"
rendered: "2026-09-17T13:01:15+00:00"
---

# Bar ViewHelper \<c:chart.bar> {#bar-viewhelper-c-chart-bar}

ViewHelper to include a bar chart with `Charts.js`.

Go to the source code of this ViewHelper:
[BarViewHelper.php](https://github.com/YolfTypo3/SavCharts/blob/main/Classes/ViewHelpers/Chart/BarViewHelper.php) (GitHub).

## Quick Test {#quick-test}

```xml
<c:template id="1">
EXT:sav_charts/Resources/Private/Templates/ChartsExamples/FluidParser/BarChart.fluid"
</c:template>
```

![](../../../../Images/ScreenShots/Charts/barChart.png)

## Arguments {#arguments}

-   **id**

    -   *Required:* true
    -   *Type:* string

    Chart ID

-   **data**

    -   *Required:* true
    -   *Type:* mixed

    Data, or a reference to data

-   **options**

    -   *Type:* mixed

    Options, or a reference to options

-   **width**

    -   *Type:* string
    -   *Default:* 600

    Width value, or a reference to the width value

-   **height**

    -   *Type:* string
    -   *Default:* 400

    Height value, or a reference to the height value

## Examples {#examples}

### Defining a Bar Chart {#defining-a-bar-chart}

```xml
<c:charts>
    <c:chart.bar id="1" data="data__barChartData" options="data__barChartOptions" >
        ...
    </c:chart.bar>
</c:charts>
```
