Save This Page
Home » jcommon-1.0.13 » org.jfree » chart » renderer » xy » [javadoc | source]
org.jfree.chart.renderer.xy
public class: CandlestickRenderer [javadoc | source]
java.lang.Object
   org.jfree.chart.renderer.AbstractRenderer
      org.jfree.chart.renderer.xy.AbstractXYItemRenderer
         org.jfree.chart.renderer.xy.CandlestickRenderer

All Implemented Interfaces:
    PublicCloneable, Cloneable, Serializable, XYItemRenderer

A renderer that draws candlesticks on an XYPlot (requires a OHLCDataset ).

This renderer does not include code to calculate the crosshair point for the plot.
Field Summary
public static final  int WIDTHMETHOD_AVERAGE    The average width method. 
public static final  int WIDTHMETHOD_SMALLEST    The smallest width method. 
public static final  int WIDTHMETHOD_INTERVALDATA    The interval data method. 
Fields inherited from org.jfree.chart.renderer.AbstractRenderer:
ZERO,  DEFAULT_PAINT,  DEFAULT_OUTLINE_PAINT,  DEFAULT_STROKE,  DEFAULT_OUTLINE_STROKE,  DEFAULT_SHAPE,  DEFAULT_VALUE_LABEL_FONT,  DEFAULT_VALUE_LABEL_PAINT
Constructor:
 public CandlestickRenderer() 
 public CandlestickRenderer(double candleWidth) 
 public CandlestickRenderer(double candleWidth,
    boolean drawVolume,
    XYToolTipGenerator toolTipGenerator) 
    Creates a new renderer for candlestick charts.

    Use -1 for the candle width if you prefer the width to be calculated automatically.

    Parameters:
    candleWidth - the candle width.
    drawVolume - a flag indicating whether or not volume bars should be drawn.
    toolTipGenerator - the tool tip generator. null is none.
Method from org.jfree.chart.renderer.xy.CandlestickRenderer Summary:
clone,   drawItem,   drawVolume,   equals,   findRangeBounds,   getAutoWidthFactor,   getAutoWidthGap,   getAutoWidthMethod,   getCandleWidth,   getDownPaint,   getDrawVolume,   getMaxCandleWidthInMilliseconds,   getUpPaint,   getUseOutlinePaint,   getVolumePaint,   initialise,   setAutoWidthFactor,   setAutoWidthGap,   setAutoWidthMethod,   setCandleWidth,   setDownPaint,   setDrawVolume,   setMaxCandleWidthInMilliseconds,   setUpPaint,   setUseOutlinePaint,   setVolumePaint
Methods from org.jfree.chart.renderer.xy.AbstractXYItemRenderer:
addAnnotation,   addAnnotation,   addEntity,   calculateDomainMarkerTextAnchorPoint,   clone,   drawAnnotations,   drawDomainGridLine,   drawDomainLine,   drawDomainMarker,   drawItemLabel,   drawRangeLine,   drawRangeMarker,   equals,   fillDomainGridBand,   fillRangeGridBand,   findDomainBounds,   findRangeBounds,   getBaseItemLabelGenerator,   getBaseToolTipGenerator,   getDefaultEntityRadius,   getDrawingSupplier,   getItemLabelGenerator,   getItemLabelGenerator,   getLegendItem,   getLegendItemLabelGenerator,   getLegendItemToolTipGenerator,   getLegendItemURLGenerator,   getLegendItems,   getPassCount,   getPlot,   getSeriesItemLabelGenerator,   getSeriesToolTipGenerator,   getToolTipGenerator,   getToolTipGenerator,   getURLGenerator,   initialise,   isPointInRect,   removeAnnotation,   removeAnnotations,   setBaseItemLabelGenerator,   setBaseToolTipGenerator,   setDefaultEntityRadius,   setItemLabelGenerator,   setLegendItemLabelGenerator,   setLegendItemToolTipGenerator,   setLegendItemURLGenerator,   setPlot,   setSeriesItemLabelGenerator,   setSeriesToolTipGenerator,   setToolTipGenerator,   setURLGenerator,   updateCrosshairValues,   updateCrosshairValues
Methods from org.jfree.chart.renderer.AbstractRenderer:
addChangeListener,   calculateLabelAnchorPoint,   clone,   equals,   fireChangeEvent,   getAutoPopulateSeriesFillPaint,   getAutoPopulateSeriesOutlinePaint,   getAutoPopulateSeriesOutlineStroke,   getAutoPopulateSeriesPaint,   getAutoPopulateSeriesShape,   getAutoPopulateSeriesStroke,   getBaseCreateEntities,   getBaseFillPaint,   getBaseItemLabelFont,   getBaseItemLabelPaint,   getBaseItemLabelsVisible,   getBaseNegativeItemLabelPosition,   getBaseOutlinePaint,   getBaseOutlineStroke,   getBasePaint,   getBasePositiveItemLabelPosition,   getBaseSeriesVisible,   getBaseSeriesVisibleInLegend,   getBaseShape,   getBaseStroke,   getCreateEntities,   getDrawingSupplier,   getItemCreateEntity,   getItemFillPaint,   getItemLabelAnchorOffset,   getItemLabelFont,   getItemLabelFont,   getItemLabelPaint,   getItemLabelPaint,   getItemOutlinePaint,   getItemOutlineStroke,   getItemPaint,   getItemShape,   getItemStroke,   getItemVisible,   getNegativeItemLabelPosition,   getNegativeItemLabelPosition,   getPositiveItemLabelPosition,   getPositiveItemLabelPosition,   getSeriesCreateEntities,   getSeriesFillPaint,   getSeriesItemLabelFont,   getSeriesItemLabelPaint,   getSeriesNegativeItemLabelPosition,   getSeriesOutlinePaint,   getSeriesOutlineStroke,   getSeriesPaint,   getSeriesPositiveItemLabelPosition,   getSeriesShape,   getSeriesStroke,   getSeriesVisible,   getSeriesVisible,   getSeriesVisibleInLegend,   getSeriesVisibleInLegend,   hasListener,   hashCode,   isItemLabelVisible,   isSeriesItemLabelsVisible,   isSeriesVisible,   isSeriesVisibleInLegend,   lookupSeriesFillPaint,   lookupSeriesOutlinePaint,   lookupSeriesOutlineStroke,   lookupSeriesPaint,   lookupSeriesShape,   lookupSeriesStroke,   notifyListeners,   removeChangeListener,   setAutoPopulateSeriesFillPaint,   setAutoPopulateSeriesOutlinePaint,   setAutoPopulateSeriesOutlineStroke,   setAutoPopulateSeriesPaint,   setAutoPopulateSeriesShape,   setAutoPopulateSeriesStroke,   setBaseCreateEntities,   setBaseCreateEntities,   setBaseFillPaint,   setBaseFillPaint,   setBaseItemLabelFont,   setBaseItemLabelFont,   setBaseItemLabelPaint,   setBaseItemLabelPaint,   setBaseItemLabelsVisible,   setBaseItemLabelsVisible,   setBaseItemLabelsVisible,   setBaseNegativeItemLabelPosition,   setBaseNegativeItemLabelPosition,   setBaseOutlinePaint,   setBaseOutlinePaint,   setBaseOutlineStroke,   setBaseOutlineStroke,   setBasePaint,   setBasePaint,   setBasePositiveItemLabelPosition,   setBasePositiveItemLabelPosition,   setBaseSeriesVisible,   setBaseSeriesVisible,   setBaseSeriesVisibleInLegend,   setBaseSeriesVisibleInLegend,   setBaseShape,   setBaseShape,   setBaseStroke,   setBaseStroke,   setCreateEntities,   setCreateEntities,   setFillPaint,   setFillPaint,   setItemLabelAnchorOffset,   setItemLabelFont,   setItemLabelFont,   setItemLabelPaint,   setItemLabelPaint,   setItemLabelsVisible,   setItemLabelsVisible,   setItemLabelsVisible,   setNegativeItemLabelPosition,   setNegativeItemLabelPosition,   setOutlinePaint,   setOutlinePaint,   setOutlineStroke,   setOutlineStroke,   setPaint,   setPaint,   setPositiveItemLabelPosition,   setPositiveItemLabelPosition,   setSeriesCreateEntities,   setSeriesCreateEntities,   setSeriesFillPaint,   setSeriesFillPaint,   setSeriesItemLabelFont,   setSeriesItemLabelFont,   setSeriesItemLabelPaint,   setSeriesItemLabelPaint,   setSeriesItemLabelsVisible,   setSeriesItemLabelsVisible,   setSeriesItemLabelsVisible,   setSeriesNegativeItemLabelPosition,   setSeriesNegativeItemLabelPosition,   setSeriesOutlinePaint,   setSeriesOutlinePaint,   setSeriesOutlineStroke,   setSeriesOutlineStroke,   setSeriesPaint,   setSeriesPaint,   setSeriesPositiveItemLabelPosition,   setSeriesPositiveItemLabelPosition,   setSeriesShape,   setSeriesShape,   setSeriesStroke,   setSeriesStroke,   setSeriesVisible,   setSeriesVisible,   setSeriesVisible,   setSeriesVisible,   setSeriesVisibleInLegend,   setSeriesVisibleInLegend,   setSeriesVisibleInLegend,   setSeriesVisibleInLegend,   setShape,   setShape,   setStroke,   setStroke
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.chart.renderer.xy.CandlestickRenderer Detail:
 public Object clone() throws CloneNotSupportedException 
    Returns a clone of the renderer.
 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.
 public boolean drawVolume() 
Deprecated! As - of 1.0.5, you should use the #getDrawVolume() method.

    Returns a flag indicating whether or not volume bars are drawn on the chart.
 public boolean equals(Object obj) 
    Tests this renderer for equality with another object.
 public Range findRangeBounds(XYDataset dataset) 
    Returns the range of values the renderer requires to display all the items from the specified dataset.
 public double getAutoWidthFactor() 
    Returns the factor by which the available space automatically calculated for the candles will be multiplied to determine the actual width to use.
 public double getAutoWidthGap() 
    Returns the amount of space to leave on the left and right of each candle when automatically calculating widths.
 public int getAutoWidthMethod() 
    Returns the method of automatically calculating the candle width.
 public double getCandleWidth() 
    Returns the width of each candle.
 public Paint getDownPaint() 
    Returns the paint used to fill candles when the price moves down from open to close.
 public boolean getDrawVolume() 
    Returns a flag indicating whether or not volume bars are drawn on the chart.
 public double getMaxCandleWidthInMilliseconds() 
    Returns the maximum width (in milliseconds) of each candle.
 public Paint getUpPaint() 
    Returns the paint used to fill candles when the price moves up from open to close.
 public boolean getUseOutlinePaint() 
    Returns the flag that controls whether or not the renderer's outline paint is used to draw the candlestick outline. The default value is false.
 public Paint getVolumePaint() 
    Returns the paint that is used to fill the volume bars if they are visible.
 public XYItemRendererState initialise(Graphics2D g2,
    Rectangle2D dataArea,
    XYPlot plot,
    XYDataset dataset,
    PlotRenderingInfo info) 
    Initialises the renderer then returns the number of 'passes' through the data that the renderer will require (usually just one). 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.
 public  void setAutoWidthFactor(double autoWidthFactor) 
    Sets the factor by which the available space automatically calculated for the candles will be multiplied to determine the actual width to use.
 public  void setAutoWidthGap(double autoWidthGap) 
    Sets the amount of space to leave on the left and right of each candle when automatically calculating widths and sends a RendererChangeEvent to all registered listeners.
 public  void setAutoWidthMethod(int autoWidthMethod) 
    Sets the method of automatically calculating the candle width and sends a RendererChangeEvent to all registered listeners.

    WIDTHMETHOD_AVERAGE: Divides the entire display (ignoring scale factor) by the number of items, and uses this as the available width.
    WIDTHMETHOD_SMALLEST: Checks the interval between each item, and uses the smallest as the available width.
    WIDTHMETHOD_INTERVALDATA: Assumes that the dataset supports the IntervalXYDataset interface, and uses the startXValue - endXValue as the available width.

 public  void setCandleWidth(double width) 
    Sets the candle width and sends a RendererChangeEvent to all registered listeners.

    If you set the width to a negative value, the renderer will calculate the candle width automatically based on the space available on the chart.

 public  void setDownPaint(Paint paint) 
    Sets the paint used to fill candles when the price moves down from open to close and sends a RendererChangeEvent to all registered listeners.
 public  void setDrawVolume(boolean flag) 
    Sets a flag that controls whether or not volume bars are drawn in the background and sends a RendererChangeEvent to all registered listeners.
 public  void setMaxCandleWidthInMilliseconds(double millis) 
    Sets the maximum candle width (in milliseconds) and sends a RendererChangeEvent to all registered listeners.
 public  void setUpPaint(Paint paint) 
    Sets the paint used to fill candles when the price moves up from open to close and sends a RendererChangeEvent to all registered listeners.
 public  void setUseOutlinePaint(boolean use) 
    Sets the flag that controls whether or not the renderer's outline paint is used to draw the candlestick outline, and sends a RendererChangeEvent to all registered listeners.
 public  void setVolumePaint(Paint paint) 
    Sets the paint used to fill the volume bars, and sends a RendererChangeEvent to all registered listeners.