Package be.ceau.chart

Class DoughnutChart

java.lang.Object
be.ceau.chart.DoughnutChart
All Implemented Interfaces:
Chart

public class DoughnutChart extends Object implements Chart
  • Constructor Details

  • Method Details

    • data

      public static DoughnutData data()
      Static factory, constructs an Data implementation appropriate for a DoughnutChart.
      Returns:
      a new DoughnutData instance
    • options

      public static DoughnutOptions options()
      Static factory, constructs an Options implementation appropriate for a DoughnutChart.
      Returns:
      a new DoughnutOptions instance
    • getData

      public DoughnutData getData()
    • setData

      public DoughnutChart setData(DoughnutData data)
    • getOptions

      public DoughnutOptions getOptions()
    • setOptions

      public DoughnutChart setOptions(DoughnutOptions options)
    • getType

      public String getType()
      Specified by:
      getType in interface Chart
      Returns:
      type of this Chart implementation for proper drawing in JavaScript.
    • toJson

      public String toJson()
      Description copied from interface: Chart

      Convert this instance to Json for use with Chart.js library.

      Specified by:
      toJson in interface Chart
      Returns:
      json representation of this Chart
    • 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.

      DoughnutChart is drawable if at least one dataset has at least one data point.

      Specified by:
      isDrawable in interface Chart
      Returns:
      true if this Chart is drawable in its current state