πŸ“‰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.

Gradient Plot

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 :-

// 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
BasicLinearStrategy.GradientPlot(
    linearData = BasicDataStrategy(
        linearDataSets = linearDataSet1,
        xAxisLabels = xAxisLabels ,
        yAxisLabels = yAxisLabels.toMutableList() // Optional
    )
)

For more information about implementing custom string labels in this plot, head over to the page linked below.

πŸ“ˆString Label Line Plot

Last updated

Was this helpful?