πString Label Line Plot
Introduction
A normal line plot, also called a dot plot, is a graph that shows the frequency, or the number of times, a value occurs in a data set. Line plots are constructed with each value recorded along the horizontal axis, also called the x-axis.
A string label line plot is created when we use custom string labels for the Y Axis instead of the ones calculated internally by the library.
Also, multiple data sets can be passed through the function to create double/multiple line charts.




Code Example
According to the number of Linear Data Sets in the list, the plot shows the plotted lines for all the data sets respectively.
If you provide a single linear data set, only one line plot is created. Similarly, if you provide two coordinate sets then two line plots will be created and so on.
Example of a line 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("Worst"),
Coordinate("Bad"),
Coordinate("Average"),
Coordinate("Good"),
Coordinate("Excellent")
)
// This function draws the String Line Plot
BasicLinearStrategy.LinePlot(
linearData = BasicDataStrategy(
linearDataSets = linearDataSet1, // List<LinearDataSet>
xAxisLabels = xAxisLabels,
yAxisLabels = yAxisLabels.toMutableList()
)
)
Last updated
Was this helpful?