> 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/gradient-plot.md). Agents can also search and read this documentation through its [MCP server](https://dev-anirban.gitbook.io/jetchart/~gitbook/mcp).

# 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="https://4163479044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBOqdmtNSHPd43dHfAUCG%2Fuploads%2FzEFoXjT48AGGZQE88FRC%2FGradient%20Plot.png?alt=media&amp;token=a2a41b78-5980-404b-99a4-5a3d84dca12a" 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](https://dev-anirban.gitbook.io/jetchart/plot-tool-kit/linear-plots/string-label-line-plot.md)
{% endcontent-ref %}
