π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.
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.

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
)
)
Last updated
Was this helpful?