> For the complete documentation index, see [llms.txt](https://dev-anirban.gitbook.io/jetchart/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev-anirban.gitbook.io/jetchart/plot-tool-kit/linear-plots/bar-plot.md).

# Bar Plot

## Introduction

This is a normal bar plot that is drawn according to the linear data sets provided in the input of the functions. We can have both custom string labels and library-calculated labels in this type of plot.

{% hint style="warning" %}
Warning:- Similar to all the other linear plots, bar plots can also have more than one linear Data Set object in its list, however, it is not recommended since the UI becomes cluttered.
{% endhint %}

<div><figure><img src="/files/RRiVmocpyUEYu77wahiI" alt="" width="375"><figcaption><p>Bar Plot</p></figcaption></figure> <figure><img src="/files/Khzt6WB7qmU8SyBEZsR6" alt="" width="375"><figcaption><p>String Bar Plot</p></figcaption></figure></div>

## Code Example

According to the number of Linear Data Sets in the list, the plot shows the bars for all the data sets respectively.

If you provide a single linear data set, only **one bar plot** is created. Similarly, if you provide two coordinate sets then **two bar plots** will be created and so on.

*Example of a bar plot with a list of linear data set objects :-*&#x20;

```kotlin
// X Axis Labels Example
val xAxisLabels = listOf("Jan" , "Feb" , "Mar").toCoordinateSet()

// This function creates the Bar Plot.
BasicLinearStrategy.BarPlot(
    linearData = BasicDataStrategy(
        linearDataSets = linearDataSet1,
        xAxisLabels = xAxisLabels
    )
)
```

{% hint style="info" %}
You can also have custom string labels in bar plots. For more information on how you can implement them, head over to the page linked below.
{% endhint %}

{% content-ref url="/pages/Ylk7gXVyD959k0HvQi4j" %}
[String Label Line Plot](/jetchart/plot-tool-kit/linear-plots/string-label-line-plot.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://dev-anirban.gitbook.io/jetchart/plot-tool-kit/linear-plots/bar-plot.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.
