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 Details

    • JSparklinesDataSeries

      public JSparklinesDataSeries​(ArrayList<Double> data, Color seriesColor, String seriesLabel)
      Creates a new JSparklinesDataSeries.
      Parameters:
      data - the data to plot
      seriesColor - the color to use for the series
      seriesLabel - 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 plot
      seriesColor - the color to use for the series
      seriesLabel - the data series label
      lineType - the properties of the line when displayed as a line chart
  • Method Details

    • getData

      public ArrayList<Double> getData()
      Returns the sparkline data.
      Returns:
      the sparkline data
    • setData

      public void setData​(ArrayList<Double> data)
      Sets the sparkline data.
      Parameters:
      data - the data to set
    • getSeriesColor

      public Color getSeriesColor()
      Returns the series color.
      Returns:
      the seriesColor
    • setSeriesColor

      public void setSeriesColor​(Color seriesColor)
      Sets the series color.
      Parameters:
      seriesColor - the seriesColor to set
    • getSeriesLabel

      public String getSeriesLabel()
      Returns the label for the series.
      Returns:
      the seriesLabel
    • setSeriesLabel

      public void setSeriesLabel​(String seriesLabel)
      Set the label for the series.
      Parameters:
      seriesLabel - the seriesLabel to set
    • getLineType

      public BasicStroke getLineType()
      Returns the properties of the line. Only used when the chart is displayed as a line chart.
      Returns:
      the lineType
    • setLineType

      public void setLineType​(BasicStroke lineType)
      Set the properties of the line. Only used when the chart is displayed as a line chart.
      Parameters:
      lineType - the lineType to set
    • toString

      public String toString()
      Returns the value as a string. Note that the values are rounded to two decimals.
      Overrides:
      toString in class Object
      Returns:
      the values as a string