# Gradient Plot

## Introduction

A gradient plot is partially a line plot that has an additional gradient shadow below it to indicate its region. 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, gradient 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 %}

<figure><img src="/files/QxovkCCwFwRp2Ais7HQv" alt="" width="375"><figcaption><p>Gradient Plot</p></figcaption></figure>

## Code Example

According to the number of Linear Data Sets in the list, the plot shows the plotted lines and gradients for all the data sets respectively.

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

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

<pre class="language-kotlin"><code class="lang-kotlin">// X Axis Labels Example
val xAxisLabels = listOf("Jan" , "Feb" , "Mar").toCoordinateSet()

// y Axis Labels Example
val yAxisLabels = mutableListOf(
    Coordinate("Excellent"),
    Coordinate("Good"),
    Coordinate("Average")
)

// This function draws a Gradient Plot
<strong>BasicLinearStrategy.GradientPlot(
</strong>    linearData = BasicDataStrategy(
        linearDataSets = linearDataSet1,
        xAxisLabels = xAxisLabels ,
        yAxisLabels = yAxisLabels.toMutableList() // Optional
<strong>    )
</strong>)
</code></pre>

{% hint style="info" %}
For more information about implementing custom string labels in this plot, head over to the page linked below.&#x20;
{% 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: 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/gradient-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.
