Class GraphChart2D

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
LBChart2D, LLChart2D

public abstract class GraphChart2D extends Chart2D
An abstract class for the common methods of LBChart2D and LLChart2D. A GraphChart2D object is an area that contains axes and one or more overlaid graphs. Changes through its set methods are updated upon next repaint() or getImage() calls.
See Also:
  • Constructor Details

    • GraphChart2D

      public GraphChart2D()
      Creates a GraphChart2D object with its defaults. A GraphChart2DProperties object must be set for this object before it is used. A GraphProperties object must be added for this object before it is used. A Dataset object must be added for this object before it is used. A MultiColorsProperties object must be added for this object before it is used.
  • Method Details

    • setGraphChart2DProperties

      public final void setGraphChart2DProperties(GraphChart2DProperties props)
      Sets the GraphChart2DProperties for this GraphChart2D.
      Parameters:
      props - The GraphChart2DProperties.
    • setLayoutRatios

      public final void setLayoutRatios(float graphW, float graphH, float legendW)
      Sets the allocation of space to each component of a graph chart. There are four components: numbers axis, labels axis, graph, and legend. The ratios of the axes can be determined from the ratios of the graph and the legend. Depending on the chart type, the left and bottom axes can be the numbers axis and labels axis. The width of the left axis is 1f - graphW - legendW. The width of the bottom axis is graphW. The height of the left axis is graphH. The ratio of the legend height is always 1f.
      Parameters:
      graphW - The ratio of graph width to total.
      graphH - The ratio of graph height to total.
      legendW - The ratio of graph width to total.
      legendH - The ratio of legend height to total.
    • getGraphChart2DProperties

      public final GraphChart2DProperties getGraphChart2DProperties()
      Gets the GraphChart2DProperties for this Chart2D.
      Parameters:
      props - The GraphChart2DProperties.
    • getGraphProperties

      public final GraphProperties getGraphProperties(int i)
      Gets a graph properties based on the order the graph properties were added. First added is number zero.
      Returns:
      The graph properties object added to this chart.
    • getDataset

      public final Dataset getDataset(int i)
      Gets a dataset based on the order the dataset was added. First added is number zero.
      Returns:
      The dataset added to this chart.
    • getMultiColorsProperties

      public final MultiColorsProperties getMultiColorsProperties(int i)
      Gets a multiColorsProps based on the order the multiColorsProps was added. First added is number zero.
      Returns:
      The multiColorsProps added to this chart.
    • getWarningRegionProperties

      public final WarningRegionProperties getWarningRegionProperties(int i)
      Gets a warning region properties based on the order the properties were added. First added is number zero.
      Returns:
      The warning region properties object added to this chart.
    • addGraphProperties

      public final void addGraphProperties(GraphProperties graphProps)
      Adds a GraphProperties object to this chart.
      Parameters:
      graphProps - The graph properties to add to this chart.
    • addDataset

      public final void addDataset(Dataset dataset)
      Adds a Dataset object to this chart.
      Parameters:
      dataset - The dataset to add to this chart.
    • addMultiColorsProperties

      public final void addMultiColorsProperties(MultiColorsProperties multiColorsProps)
      Adds a MultiColorsProperties object to this chart.
      Parameters:
      multiColorsProps - The multi colors properties to add to this chart.
    • addWarningRegionProperties

      public final void addWarningRegionProperties(WarningRegionProperties warningRegionProps)
      Adds a WarningRegionProperties object to this chart.
      Parameters:
      warningRegion - The warning region properties to add to this chart.
    • removeGraphProperties

      public final void removeGraphProperties(GraphProperties graphProps)
      Removes GraphProperties object from this chart.
      Parameters:
      graphProps - The graph properties to remove from this chart.
    • removeDataset

      public final void removeDataset(Dataset dataset)
      Removes a Dataset object from this chart.
      Parameters:
      dataset - The dataset to remove from this chart.
    • removeMultiColorsProperties

      public final void removeMultiColorsProperties(MultiColorsProperties multiColorsProps)
      Removes a MultiColorsProperties object from this chart.
      Parameters:
      multiColorsProperties - The multi colors properties to remove from this chart.
    • removeWarningRegionProperties

      public final void removeWarningRegionProperties(WarningRegionProperties warningRegionProps)
      Removes a warning region with the specified properties to this chart.
      Parameters:
      warningRegion - The warning region to remove from this chart.