Class AxesBasedChart<T>

Type Parameters:
T - Chart type
All Implemented Interfaces:
DataDescriptorCallback
Direct Known Subclasses:
AreaChart, BarChart, BubbleChart, DotChart, HorizontalBarChart, HorizontalStackedBarChart, LineChart, PopulationPyramidChart, StackedAreaChart, StackedBarChart

public abstract class AxesBasedChart<T> extends SeriesBasedChart<T>
The parent class of all axis-based charts. This class cannot be instantiated, it can only be used by chart instances as a parent class. The class implements all common settings for axis-based charts.
Since:
4.0
Author:
JBStrap
  • Field Details

  • Constructor Details

    • AxesBasedChart

      protected AxesBasedChart(String name, DataDescriptor dataDescriptor, String categoryColumnName, TooltipType defaultTooltipType)
      Parameters:
      name - Chart name (required)
      dataDescriptor - The DataDescriptor that contains the chart parameters If null is specified, the chart does not receive data from the database. Instead, you have to programmatically pass the data to the chart.
      categoryColumnName - The DataDescriptor column name where the chart’s category (X axis) data come from If the chart does not use a DataDescriptor, this setting is ignored. If the chart retrieves data from a DataDescriptor and the category column name is not specified, by default it retrieves data from the CATEGORY column in the DataDescriptor.
      Throws:
      NullPointerException - Thrown if the name of the chart or the parameter class is null
      IllegalArgumentException - Thrown if there is a DataDescriptor specified for the chart, but the DataDescriptor does not contain the column specified in the parameter categoryColumnName or the parameter categoryColumnName is not specified and in the DataDescriptor there is no column by the name CATEGORY
  • Method Details

    • getXAxis

      protected Parameters getXAxis()
      Returns:
      Parameter class containing X axis settings
    • getYAxis

      protected Parameters getYAxis()
      Returns:
      Parameter class containing Y axis settings
    • setXAxisShow

      public T setXAxisShow(boolean show)
      Sets if the X axis should be displayed on the chart. By default, the X axis is displayed.
      Parameters:
      show - If true is set, the X axis is displayed on the chart If not, the X axis is not displayed.
      Returns:
      Chart instance
    • isXAxisShow

      public boolean isXAxisShow()
      Checks if the X axis is displayed on the chart.
      Returns:
      If true, the X axis is displayed on the chart, otherwise false
    • setYAxisShow

      public T setYAxisShow(boolean show)
      Sets if the Y axis should be displayed on the chart. By default, the Y axis is displayed.
      Parameters:
      show - If true is set, the Y axis is displayed on the chart If not, the Y axis is not displayed.
      Returns:
      Chart instance
    • isYAxisShow

      public boolean isYAxisShow()
      Checks if the Y axis is displayed on the chart.
      Returns:
      If true, the Y axis is displayed on the chart, otherwise false
    • setXAxisShowGrid

      public T setXAxisShowGrid(boolean showGrid)
      Sets if the gridlines on the X axis should be displayed. By default, the gridlines are not displayed.
      Parameters:
      showGrid - If true is specified, the gridlines on the X axis are displayed, helping the user to determine the position of a data point on the axis. If false, the gridlines are not displayed.
      Returns:
      Chart instance
    • isXAxisShowGrid

      public boolean isXAxisShowGrid()
      Checks if the gridlines on the X axis are displayed on the chart.
      Returns:
      If true, the gridlines on the X axis are displayed on the chart, Otherwise, false is set.
    • setYAxisShowGrid

      public T setYAxisShowGrid(boolean showGrid)
      Sets if the gridlines on the Y axis should be displayed. By default, the gridlines are not displayed.
      Parameters:
      showGrid - If true is specified, the gridlines on the Y axis are displayed, helping the user to determine the position of a data point on the axis. If false, the gridlines are not displayed.
      Returns:
      Chart instance
    • isYAxisShowGrid

      public boolean isYAxisShowGrid()
      Checks if the gridlines on the Y axis are displayed on the chart.
      Returns:
      If true, the gridlines on the Y axis are displayed on the chart, Otherwise, false is set.
    • setXAxisTitle

      public T setXAxisTitle(String title)
      Sets the title for the X axis.
      Parameters:
      title - X axis title If not specified or null is specified, no title is displayed on the axis.
      Returns:
      Chart instance
    • getXAxisTitle

      public String getXAxisTitle()
      Gets the title of the X axis.
      Returns:
      X axis title If not specified, the method returns null.
    • setYAxisTitle

      public T setYAxisTitle(String title)
      Sets the title for the Y axis.
      Parameters:
      title - Y axis title If not specified or null is specified, no title is displayed on the axis.
      Returns:
      Chart instance
    • getYAxisTitle

      public String getYAxisTitle()
      Gets the title for the Y axis.
      Returns:
      Y axis title If not specified, the method returns null.
    • setXAxisStriped

      public T setXAxisStriped(boolean striped)
      Sets if the X axis should be striped. By default, the X axis is not striped. If this setting is applied, the intervals between every second value on the axis are darkened so that the axis values appear striped. This feature helps the user to better navigate between data values on the X axis.
      Parameters:
      striped - If true is set, the axis is striped, otherwise not striped
      Returns:
      Chart instance
    • isXAxisStriped

      public boolean isXAxisStriped()
      Checks if the X axis is striped or not.
      Returns:
      If true, the X axis is displayed on the chart, otherwise false
    • setYAxisStriped

      public T setYAxisStriped(boolean striped)
      Sets if the Y should be striped. By default, the Y axis is not striped. If this setting is applied, the intervals between every second value on the axis are darkened so that the axis values appear striped. This feature helps the user to better navigate between data values on the Y axis.
      Parameters:
      striped - If true is set, the axis is striped, otherwise not striped
      Returns:
      Chart instance
    • isYAxisStriped

      public boolean isYAxisStriped()
      Checks if the Y axis is striped or not.
      Returns:
      If true, the Y axis is striped, otherwise false
    • setXAxisStripedStart

      public T setXAxisStripedStart(StripedStart stripedStart)
      Sets the way the X axis should be striped. By default, the X axis is striped starting from the first interval, that is, the first interval and every interval with an odd number has a darker background.
      Parameters:
      stripedStart - Sets where the stripes start Available values are listed in the enum StripedStart. If null is specified, stripes start at the first interval, following the default setting.
      Returns:
      Chart instance
    • getXAxisStripedStrart

      public StripedStart getXAxisStripedStrart()
      Gets the starting position of the stripes on the X axis.
      Returns:
      Starting position of the stripes on the X axis
    • setYAxisStripedStart

      public T setYAxisStripedStart(StripedStart stripedStart)
      Sets the way the Y axis should be striped. By default, the Y axis is striped starting from the first interval, that is, the first interval and every interval with an odd number has a darker background.
      Parameters:
      stripedStart - Sets where the stripes start Available values are listed in the enum StripedStart. If null is specified, stripes start at the first interval, following the default setting.
      Returns:
      Chart instance
    • getYAxisStripedStrart

      public StripedStart getYAxisStripedStrart()
      Gets the starting position of the stripes on the Y axis.
      Returns:
      Starting position of the stripes on the Y axis
    • setXAxisValuePrefix

      public T setXAxisValuePrefix(String prefix)
      Sets the prefix for the values on the X axis.
      Parameters:
      prefix - Prefix If null is specified, no prefix is displayed before the values.
      Returns:
      Chart instance
    • getXAxisValuePrefix

      public String getXAxisValuePrefix()
      Gets the prefix for the values on the X axis.
      Returns:
      Prefix for the values on the X axis or null if no prefix is set for the values
    • setYAxisValuePrefix

      public T setYAxisValuePrefix(String prefix)
      Sets the prefix for the values on the Y axis.
      Parameters:
      prefix - Prefix If null is specified, no prefix is displayed before the values.
      Returns:
      Chart instance
    • getYAxisValuePrefix

      public String getYAxisValuePrefix()
      Gets the prefix for the values on the Y axis.
      Returns:
      Prefix for the values on the Y axis or null if no prefix is set for the values
    • setXAxisValuePostfix

      public T setXAxisValuePostfix(String postfix)
      Sets the postfix for the values on the X axis.
      Parameters:
      postfix - Postfix for the values If null is specified, no postfix is displayed after the values.
      Returns:
      Chart instance
    • getXAxisValuePostfix

      public String getXAxisValuePostfix()
      Gets the postfix for the values on the X axis.
      Returns:
      Postfix for the values on the X axis or null if no postfix is set for the values
    • setYAxisValuePostfix

      public T setYAxisValuePostfix(String postfix)
      Sets a postfix for the values on the Y axis.
      Parameters:
      postfix - Postfix for the values If null is specified, no postfix is displayed after the values.
      Returns:
      Chart instance
    • getYAxisValuePostfix

      public String getYAxisValuePostfix()
      Gets the postfix for the values on the Y axis.
      Returns:
      Postfix for the values on the Y axis or null if no postfix is set for the values
    • setXAxisFontColor

      public T setXAxisFontColor(String color)
      Sets the font color on the X axis.
      Parameters:
      color - X axis font color If not specified or null is specified, labels are displayed using the theme’s grey color.
      Returns:
      Chart instance
    • getXAxisFontColor

      public String getXAxisFontColor()
      Gets the color of the labels on the X axis.
      Returns:
      The color of the labels on the X axis If not specified, the method returns null.
    • setYAxisFontColor

      public T setYAxisFontColor(String color)
      Sets the color of the labels on the Y axis.
      Parameters:
      color - The color of the label on the Y axis. If not specified or null is specified, labels are displayed using the theme’s grey color.
      Returns:
      Chart instance
    • getYAxisFontColor

      public String getYAxisFontColor()
      Gets the color of the labels on the Y axis.
      Returns:
      Y axis label color If not specified, the method returns null.
    • setXAxisShowValueLabel

      public T setXAxisShowValueLabel(boolean showValueLabel)
      Sets if the values on the X axis should be displayed as labels. By default, values on the axis are displayed.
      Parameters:
      showValueLabel - If true is specified, labels are displayed on the axis, otherwise not
      Returns:
      Chart instance
    • isXAxisShowValueLabel

      public boolean isXAxisShowValueLabel()
      Checks if the labels are displayed on the X axis.
      Returns:
      If true, values on the X axis are displayed, otherwise not
    • setYAxisShowValueLabel

      public T setYAxisShowValueLabel(boolean showValueLabel)
      Sets if the values on the Y axis should be displayed as labels. By default, values on the axis are displayed.
      Parameters:
      showValueLabel - If true is specified, labels are displayed on the axis, otherwise not
      Returns:
      Chart instance
    • isYAxisShowValueLabel

      public boolean isYAxisShowValueLabel()
      Checks if the labels are displayed on the Y axis.
      Returns:
      If true, the labels on the Y axis are displayed, otherwise not
    • setXAxisShowLine

      public T setXAxisShowLine(boolean showLine)
      Sets if the X axis line is displayed on the chart. By default, the axis line is displayed.
      Parameters:
      showLine - If true, the axis line is displayed on the chart, otherwise not
      Returns:
      Chart instance
    • isXAxisShowLine

      public boolean isXAxisShowLine()
      Checks if the X axis is displayed on the chart.
      Returns:
      If true, the X axis line is displayed on the chart, otherwise false
    • setYAxisShowLine

      public T setYAxisShowLine(boolean showLine)
      Sets if the Y axis line is displayed on the chart. By default, the axis line is displayed.
      Parameters:
      showLine - If true, the axis line is displayed on the chart, otherwise not
      Returns:
      Chart instance
    • isYAxisShowLine

      public boolean isYAxisShowLine()
      Checks if the Y axis is displayed on the chart.
      Returns:
      If true, the Y axis line is displayed on the chart, otherwise not
    • setXAxisShowTicks

      public T setXAxisShowTicks(boolean showTicks)
      Sets if the value-marking ticks are displayed on the X axis. By default, ticks are displayed on the X axis.
      Parameters:
      showTicks - If true is specified, ticks are displayed, Otherwise not
      Returns:
      Chart instance
    • isXAxisShowTicks

      public boolean isXAxisShowTicks()
      Checks if the ticks are displayed on the X axis.
      Returns:
      If true, ticks are displayed, otherwise false
    • setYAxisShowTicks

      public T setYAxisShowTicks(boolean showTicks)
      Sets if the value-marking ticks are displayed on the Y axis. By default, ticks are displayed on the Y axis.
      Parameters:
      showTicks - If true is specified, ticks are displayed, Otherwise not
      Returns:
      Chart instance
    • isYAxisShowTicks

      public boolean isYAxisShowTicks()
      Checks if the ticks are displayed on the Y axis.
      Returns:
      If true, ticks are displayed, otherwise false
    • setXAxisType

      protected T setXAxisType(AxisType axisType)
      Sets the data type of the X axis. The default data type of the X axis is TEXT. If the data are specified using a DataDescriptor, the X axis automatically takes the necessary data type. This setting cannot be modified once the chart has been displayed.
      Parameters:
      axisType - X axis data type * Available types are listed in the enum AxisType. If null is specified, the data type of the X axis is text. Values on the X axis are displayed as text.
      Returns:
      Chart instance
    • getXAxisType

      public AxisType getXAxisType()
      Gets the data type of the X axis.
      Returns:
      X axis data type
    • setXAxisDateFormat

      public T setXAxisDateFormat(String pattern)
      The format of the date type values on the X axis. If the X axis is not a date type axis, this setting is ignored.
      Parameters:
      pattern - The format of the dates on the X axis If null is specified, the framework’s default date format.
      Returns:
      Chart instance
    • getXAxisDateFormat

      public String getXAxisDateFormat()
      Determines the date format of the X axis.
      Returns:
      The date format of the X axis
    • setXAxisTickTextRotate

      public T setXAxisTickTextRotate(TickTextRotate tickTextRotate)
      Sets the rotation of the texts on the X axis. By default, data values on the X axis are automatically rotated according to the length of the data values.
      Parameters:
      tickTextRotate - Rotation angle of the texts on the X axis Available values are listed in the enum TickTextRotate. If null is set, data values are automatically rotated.
      Returns:
      Chart instance
    • getXAxisTickTextRotate

      public TickTextRotate getXAxisTickTextRotate()
      Gets the rotation of the data values on the X axis.
      Returns:
      Rotation of the data values on the X axis
    • setYAxisMinValue

      public T setYAxisMinValue(Number minValue)
      Sets the start value of the Y axis. If the data series contains a value smaller than the one specified, values smaller than the minimum value are not displayed on the chart. By default, the chart’s minimum value is not specified and every data point is displayed.
      Parameters:
      minValue - Minimum value of the Y axis If null is set, no minimum value is specified for the axis
      Returns:
      Chart instance
    • getYAxisMinValue

      public Number getYAxisMinValue()
      Gets the start value of the Y axis.
      Returns:
      Start value of the Y axis If not specified, the method returns null.
    • setYAxisMaxValue

      public T setYAxisMaxValue(Number maxValue)
      Sets the maximum values of the Y axis. If the data series contains a value greater than the one specified, values greater than the maximum value are not displayed on the chart. By default, the chart’s maximum value is not specified and every data point is displayed.
      Parameters:
      maxValue - Y axis maximum value If null is set, no maximum value is specified for the axis
      Returns:
      Chart instance
    • getYAxisMaxValue

      public Number getYAxisMaxValue()
      Gets the maximum value for the Y axis.
      Returns:
      Y axis maximum value If not specified, the method returns null.
    • init

      protected void init()
      Description copied from class: BaseChart
      Chart initialization.
      Specified by:
      init in class BaseChart<T>