Module platform

Class SamplingXYLineRenderer

All Implemented Interfaces:
Serializable, Cloneable, EventListener, AnnotationChangeListener, LegendItemSource, XYItemRenderer, PublicCloneable

public class SamplingXYLineRenderer extends AbstractXYItemRenderer implements XYItemRenderer, Cloneable, PublicCloneable, Serializable
A renderer that draws line charts. The renderer doesn't necessarily plot every data item - instead, it tries to plot only those data items that make a difference to the visual output (the other data items are skipped). This renderer is designed for use with the XYPlot class.
See Also:
  • Constructor Details

    • SamplingXYLineRenderer

      public SamplingXYLineRenderer()
      Creates a new renderer.
  • Method Details

    • getPassCount

      public int getPassCount()
      Returns the number of passes through the data that the renderer requires in order to draw the chart. Most charts will require a single pass, but some require two passes.
      Specified by:
      getPassCount in interface XYItemRenderer
      Overrides:
      getPassCount in class AbstractXYItemRenderer
      Returns:
      The pass count.
    • initialise

      public XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info)
      Initialises the renderer.

      This method will be called before the first item is rendered, giving the renderer an opportunity to initialise any state information it wants to maintain. The renderer can do nothing if it chooses.

      Specified by:
      initialise in interface XYItemRenderer
      Overrides:
      initialise in class AbstractXYItemRenderer
      Parameters:
      g2 - the graphics device.
      dataArea - the area inside the axes.
      plot - the plot.
      data - the data.
      info - an optional info collection object to return data back to the caller.
      Returns:
      The renderer state.
    • drawItem

      public void drawItem(Graphics2D g2, XYItemRendererState state, Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass)
      Draws the visual representation of a single data item.
      Specified by:
      drawItem in interface XYItemRenderer
      Parameters:
      g2 - the graphics device.
      state - the renderer state.
      dataArea - the area within which the data is being drawn.
      info - collects information about the drawing.
      plot - the plot (can be used to obtain standard color information etc).
      domainAxis - the domain axis.
      rangeAxis - the range axis.
      dataset - the dataset.
      series - the series index (zero-based).
      item - the item index (zero-based).
      crosshairState - crosshair information for the plot (null permitted).
      pass - the pass index.
    • clone

      public Object clone() throws CloneNotSupportedException
      Returns a clone of the renderer.
      Specified by:
      clone in interface PublicCloneable
      Overrides:
      clone in class AbstractXYItemRenderer
      Returns:
      A clone.
      Throws:
      CloneNotSupportedException - if the clone cannot be created.
    • equals

      public boolean equals(Object obj)
      Tests this renderer for equality with an arbitrary object.
      Overrides:
      equals in class AbstractXYItemRenderer
      Parameters:
      obj - the object (null permitted).
      Returns:
      true or false.