Class BarChart

All Implemented Interfaces:
Chart<BarChart,BarOptions,BarData>

public class BarChart extends HomogeneousChart<BarChart,BarOptions,BarData>
  • Constructor Details

    • BarChart

      public BarChart()
    • BarChart

      public BarChart(BarData data)
    • BarChart

      public BarChart(BarData data, BarOptions options)
  • Method Details

    • data

      public static BarData data()
      Static factory, constructs an HomogeneousData implementation appropriate for a BarChart.
      Returns:
      a new BarData instance
    • options

      public static BarOptions options()
      Static factory, constructs an Options implementation appropriate for a BarChart.
      Returns:
      a new BarOptions instance
    • getType

      public String getType()
      Returns:
      type of this Chart implementation for proper drawing in JavaScript.
    • isDrawable

      public boolean isDrawable()

      Optional check to determine whether the current state of this Chart implementation instance will generate a drawable JSON string.

      Implementations provide a best-effort evaluation, and can not guarantee that the serialized chart will be rendered correctly.

      A BarChart is drawable if:

      • at least one dataset has at least one data point
      • an xAxis scale exists with the id of the xAxisID set on a dataset, if such an id set
      • a yAxis scale exists with the id of the yAxisID set on a dataset, if such an id is set
      • there is at least one label in the BarData
      Returns:
      true if this BarChart is drawable in its current state