Package no.uib.jsparklines.data
Class JSparklinesDataSeries
java.lang.Object
no.uib.jsparklines.data.JSparklinesDataSeries
public class JSparklinesDataSeries extends Object
Object containing a sparkline data series to be added to a
JSparklinesDataset.
- Author:
- Harald Barsnes
-
Constructor Summary
Constructors Constructor Description JSparklinesDataSeries(ArrayList<Double> data, Color seriesColor, String seriesLabel)
Creates a new JSparklinesDataSeries.JSparklinesDataSeries(ArrayList<Double> data, Color seriesColor, String seriesLabel, BasicStroke lineType)
Creates a new JSparklinesDataSeries. -
Method Summary
Modifier and Type Method Description ArrayList<Double>
getData()
Returns the sparkline data.BasicStroke
getLineType()
Returns the properties of the line.Color
getSeriesColor()
Returns the series color.String
getSeriesLabel()
Returns the label for the series.void
setData(ArrayList<Double> data)
Sets the sparkline data.void
setLineType(BasicStroke lineType)
Set the properties of the line.void
setSeriesColor(Color seriesColor)
Sets the series color.void
setSeriesLabel(String seriesLabel)
Set the label for the series.String
toString()
Returns the value as a string.
-
Constructor Details
-
JSparklinesDataSeries
Creates a new JSparklinesDataSeries.- Parameters:
data
- the data to plotseriesColor
- the color to use for the seriesseriesLabel
- the data series label
-
JSparklinesDataSeries
public JSparklinesDataSeries(ArrayList<Double> data, Color seriesColor, String seriesLabel, BasicStroke lineType)Creates a new JSparklinesDataSeries.- Parameters:
data
- the data to plotseriesColor
- the color to use for the seriesseriesLabel
- the data series labellineType
- the properties of the line when displayed as a line chart
-
-
Method Details
-
getData
Returns the sparkline data.- Returns:
- the sparkline data
-
setData
Sets the sparkline data.- Parameters:
data
- the data to set
-
getSeriesColor
Returns the series color.- Returns:
- the seriesColor
-
setSeriesColor
Sets the series color.- Parameters:
seriesColor
- the seriesColor to set
-
getSeriesLabel
Returns the label for the series.- Returns:
- the seriesLabel
-
setSeriesLabel
Set the label for the series.- Parameters:
seriesLabel
- the seriesLabel to set
-
getLineType
Returns the properties of the line. Only used when the chart is displayed as a line chart.- Returns:
- the lineType
-
setLineType
Set the properties of the line. Only used when the chart is displayed as a line chart.- Parameters:
lineType
- the lineType to set
-
toString
Returns the value as a string. Note that the values are rounded to two decimals.
-