Class BarChartDataSet

java.lang.Object
org.primefaces.model.charts.ChartDataSet
org.primefaces.model.charts.bar.BarChartDataSet
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HorizontalBarChartDataSet

public class BarChartDataSet extends ChartDataSet
Used to provide DataSet objects to Bar chart component.
See Also:
  • Constructor Details

    • BarChartDataSet

      public BarChartDataSet()
  • Method Details

    • getData

      public List<Number> getData()
      Gets the list of data in this dataSet
      Returns:
      List<Number> list of data
    • setData

      public void setData(List<Number> data)
      Sets the list of data in this dataSet
      Parameters:
      data - List<Number> list of data
    • getLabel

      public String getLabel()
      Gets the label
      Returns:
      label
    • setLabel

      public void setLabel(String label)
      Sets the label
      Parameters:
      label - The label for the dataset which appears in the legend and tooltips
    • getXaxisID

      public String getXaxisID()
      Gets the xAxisID
      Returns:
      xAxisID
    • setXaxisID

      public void setXaxisID(String xaxisID)
      Sets the xAxisID
      Parameters:
      xaxisID - The ID of the x axis to plot this dataset on. If not specified, this defaults to the ID of the first found x axis
    • getYaxisID

      public String getYaxisID()
      Gets the yAxisID
      Returns:
      yAxisID
    • setYaxisID

      public void setYaxisID(String yaxisID)
      Sets the yAxisID
      Parameters:
      yaxisID - The ID of the y axis to plot this dataset on. If not specified, this defaults to the ID of the first found y axis.
    • getStack

      public String getStack()
      Gets the stack
      Returns:
      stack
    • setStack

      public void setStack(String stack)
      Sets the stack
      Parameters:
      stack - The ID of the group to which this dataset belongs to (when stacked, each group will be a separate stack)
    • getBackgroundColor

      public Object getBackgroundColor()
      Gets the backgroundColor
      Returns:
      backgroundColor
    • setBackgroundColor

      public void setBackgroundColor(Object backgroundColor)
      Sets the backgroundColor
      Parameters:
      backgroundColor - The fill color of the bar.
    • getBorderColor

      public Object getBorderColor()
      Gets the borderColor
      Returns:
      borderColor
    • setBorderColor

      public void setBorderColor(Object borderColor)
      Sets the borderColor
      Parameters:
      borderColor - The color of the bar border.
    • getBorderWidth

      public Object getBorderWidth()
      Gets the borderWidth
      Returns:
      borderWidth
    • setBorderWidth

      public void setBorderWidth(Object borderWidth)
      Sets the borderWidth
      Parameters:
      borderWidth - The stroke width of the bar in pixels.
    • getBorderSkipped

      public String getBorderSkipped()
      Gets the borderSkipped
      Returns:
      borderSkipped
    • setBorderSkipped

      public void setBorderSkipped(String borderSkipped)
      Sets the borderSkipped
      Parameters:
      borderSkipped - Which edge to skip drawing the border for.
    • getHoverBackgroundColor

      public Object getHoverBackgroundColor()
      Gets the hoverBackgroundColor
      Returns:
      hoverBackgroundColor
    • setHoverBackgroundColor

      public void setHoverBackgroundColor(Object hoverBackgroundColor)
      Sets the hoverBackgroundColor
      Parameters:
      hoverBackgroundColor - The fill colour of the bars when hovered.
    • getHoverBorderColor

      public Object getHoverBorderColor()
      Gets the hoverBorderColor
      Returns:
      hoverBorderColor
    • setHoverBorderColor

      public void setHoverBorderColor(Object hoverBorderColor)
      Sets the hoverBorderColor
      Parameters:
      hoverBorderColor - The stroke colour of the bars when hovered.
    • getHoverBorderWidth

      public Object getHoverBorderWidth()
      Gets the hoverBorderWidth
      Returns:
      hoverBorderWidth
    • setHoverBorderWidth

      public void setHoverBorderWidth(Object hoverBorderWidth)
      Sets the hoverBorderWidth
      Parameters:
      hoverBorderWidth - The stroke width of the bars when hovered.
    • getType

      public String getType()
      Gets the type
      Returns:
      type of current chart
    • encode

      public String encode() throws IOException
      Write the options of this dataSet
      Overrides:
      encode in class ChartDataSet
      Returns:
      options as JSON object
      Throws:
      IOException - If an I/O error occurs