|
Chart Builder API (beta) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--oracle.ord.media.chart.Chart | +--oracle.ord.media.chart.legend.Legend | +--oracle.ord.media.chart.axischart.AxisChart | +--oracle.ord.media.chart.axischart.AxisChartInteractive
AxisChartInteractive is a subclass of AxisChart that is used to implement interactive and animated axis charts. This class provides methods for determining mouse entry and exit of series elements, highlighting series elements, and displaying popup labels. This class also provides methods for creating animated charts, such as Strip charts. These methods are most useful in Java Applets and Java Applications.
The methods getSeriesElementEntered(int x, int y), getSeriesElementExited(int x, int y), and getSeriesIndexDesc(int x, int y) are provided to support interactive applications. These calls enable one to detect mouse entry and exit from series elements, such as a bar in a bar chart, and subsequently initiate actions triggered by the series element exit or entry.
getSeriesElementEntered() returns true if the passed (x,y) coordinate triggers a series element entry (such as the entry of a bar of a bar chart). Likewise, getSeriesElementExited() returns true if the passed coordinate (x,y) triggers a series element exit. getSeriesIndexDesc() is used to determine the index of the series element located at coordinate (x,y). The seriesIndex can be subsequently used to initiate chart actions, such as series highlighting or the display of annotations.
Series element highlighting may be triggered by series element events. setSeriesHighlight(String seriesName, int seriesIndex, Color c) alters the color of the series element (identified by seriesName and seriesIndex). setSeriesUnHighlight(String seriesName) restores the series element to its original color. Note that, for a given series, at most one series element may be highlighted an any time.
Displaying annotations associated with the series element may be triggered by series element events. Annotations are controlled by the methods setSeriesAnnotation(String seriesName, int seriesIndex) and setSeriesAnnotationRemove(String seriesName).
An animated chart, such as charts where coordinates are incrementally added, are supported as follows:
After the incremental loading of the series is complete -- that is, an observation has been added for each timestamp -- additional observations can still be added. In this case, the chart can either accommodate more points (increasing the number of observations), or the number of observations can remain fixed by shifting (removing the earliest observations and adding the more recent observations).
Adding additional observations to a "full" chart can be accomplished by invoking setXSeriesAppend(java.util.Date[]) and setYSeriesAppend(String, double[]).
Shifting in new observations to a "full" chart can be accomplished by invoking setXSeriesShift(java.util.Date[]) and setYSeriesAppend(String, double[]).
For applications that require wholesale replacement of a series or sets of series, the methods setDeleteYSeries(String, seriesName) (deletes a named series), setDeleteAllYSeries() (deletes all y series), and setDeleteAllXYSeries() (deletes all x and y series) are provided.
Inner classes inherited from class oracle.ord.media.chart.legend.Legend |
Legend.LegendElement |
Inner classes inherited from class oracle.ord.media.chart.Chart |
Chart.ChartLabel |
Fields inherited from class oracle.ord.media.chart.axischart.AxisChart |
AREA, BAR, BAR_HORIZONTAL, BAR_STACKED, CANDLESTICK, HILOCLOSE, HORIZONTAL, LINE, OPENHILOCLOSE, VERTICAL, XAXIS, XYAXIS, YAXIS |
Fields inherited from class oracle.ord.media.chart.legend.Legend |
DERIVED, EAST, NORTH, NORTHEAST, NORTHWEST, SOUTH, SOUTHEAST, SOUTHWEST, USERDEFINED, WEST |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
AxisChartInteractive()
|
Method Summary | |
void |
eraseChart()
Erase the chart. |
boolean |
getSeriesElementEntered(int x,
int y)
Return true if the cursor has entered a series element. |
boolean |
getSeriesElementExited(int x,
int y)
Return true if the cursor has exited a series element. |
int |
getSeriesIndex(int x,
int y)
Return the index of the y coordinate at screen location (x,y). |
SeriesDesc |
getSeriesIndexDesc(int x,
int y)
Return a descriptor containing the series name and index of the y coordinate at screen location (x,y). |
void |
setCandlestickSeries(java.lang.String seriesName)
Define a Candlestick series that initially has no values. |
void |
setCandlestickSeriesAppend(java.lang.String seriesName,
double[] yopen,
double[] yhigh,
double[] ylow,
double[] yclose)
Append Y-axis values for a Candlestick chart. |
void |
setDeleteAllXYSeries()
Delete all X-axis and Y-axis series, and all subcharts. |
void |
setDeleteAllYSeries()
Delete all Y-axis series. |
void |
setDeleteYSeries(java.lang.String seriesName)
Delete the named series. |
void |
setHiLoCloseSeries(java.lang.String seriesName)
Define a HiLoClose series that initially has no values. |
void |
setHiLoCloseSeriesAppend(java.lang.String seriesName,
double[] yhigh,
double[] ylow,
double[] yclose)
Append Y-axis values for a High/Low/Close chart. |
void |
setOpenHiLoCloseSeries(java.lang.String seriesName)
Define an OpenHiLoClose series that initially has no values. |
void |
setOpenHiLoCloseSeriesAppend(java.lang.String seriesName,
double[] yopen,
double[] yhigh,
double[] ylow,
double[] yclose)
Append Y-axis values for a Open/High/Low/Close chart. |
void |
setSeriesAnnotation(java.lang.String seriesName,
int seriesIndex)
Display an annotation for the specified element of the named series. |
void |
setSeriesAnnotationRemove()
Remove the annotation from the series element of any and all series. |
void |
setSeriesAnnotationRemove(java.lang.String seriesName)
Remove the annotation from the series element of the named series. |
void |
setSeriesHighlight(java.lang.String seriesName,
int seriesIndex,
java.awt.Color c)
Highlight one element of the named series. |
void |
setSeriesUnHighlight()
Remove the highlighting of the series element of any and all series. |
void |
setSeriesUnHighlight(java.lang.String seriesName)
Remove the highlighting of the series element of the named series. |
void |
setXSeriesAppend(java.util.Date[] tstamps)
Extend the time axis by appending additional Dates. |
void |
setXSeriesReserve(int numTimestamps)
Reserve space for the chart's X-axis. |
void |
setXSeriesReserveLabels(int numLabels)
|
void |
setXSeriesShift(java.util.Date[] tstamps)
Shift the X-axis by appending additional Dates to the tail, deleting Dates from the head. |
void |
setYSeries(java.lang.String seriesName)
Define a series that initially has no values. |
void |
setYSeriesAppend(java.lang.String seriesName,
double[] yvalues)
Append an array of Y-axis values to an existing series. |
void |
setYSeriesSparseAppend(java.lang.String seriesName,
java.util.Date[] tstamps,
double[] yvalues)
Append a sparse array of Y-axis values to an existing sparse series. |
Methods inherited from class oracle.ord.media.chart.legend.Legend |
getLegendAlignment, getLegendBackground, getLegendDisable, getLegendDisplaySingleSeries, getLegendEdgeColor, getLegendEdgeDisable, getLegendForeground, getLegendInside, setLegendAlignment, setLegendBackground, setLegendDisable, setLegendDisplaySingleSeries, setLegendEdgeColor, setLegendEdgeDisable, setLegendFont, setLegendForeground, setLegendInside, setLegendOffsetX, setLegendOffsetY |
Methods inherited from class oracle.ord.media.chart.Chart |
getBackground, getBorderBottom, getBorderLeft, getBorderRight, getBorderTop, getEdgeColor, getFootnote, getHeight, getMinimumSize, getPreferredSize, getRenderingHintsChart, getSize, getSubtitle, getTitle, getVersion, getWidth, isSetRenderingHintsChart, setBackground, setBorderBottom, setBorderLeft, setBorderRight, setBorderTop, setEdgeColor, setRenderingHintsChart, setTitlesForeground |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAccessibleContext, getAlignmentX, getAlignmentY, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getGraphics, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setLocale, setLocation, setLocation, setName, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AxisChartInteractive()
Method Detail |
public void setXSeriesReserve(int numTimestamps) throws ChartException
numTimestamps
- Number of timestamps for which to reserve space.setXSeriesAppend(java.util.Date[])
,
setYSeriesAppend(String, double[])
public void setXSeriesReserveLabels(int numLabels) throws ChartException
public void setXSeriesAppend(java.util.Date[] tstamps) throws ChartException
public void setXSeriesShift(java.util.Date[] tstamps) throws ChartException
tstamps[]
- Array of java.util.Date to be appended
to the end of the time axis.public void setYSeries(java.lang.String seriesName) throws ChartException
seriesName
- Name of series.public void setHiLoCloseSeries(java.lang.String seriesName) throws ChartException
seriesName
- Name of series.public void setOpenHiLoCloseSeries(java.lang.String seriesName) throws ChartException
seriesName
- Name of series.public void setCandlestickSeries(java.lang.String seriesName) throws ChartException
seriesName
- Name of series.public void setYSeriesAppend(java.lang.String seriesName, double[] yvalues) throws ChartException
Note that the number of timestamps remains fixed. To extend a time series and its associated timestamps, first delete all series with setDeleteAllXYSeries(), then reload the X and Y-axis series with setXSeries() and setYSeries().
seriesName
- Name of series.yvalues[]
- Double array of Y-axis valuessetDeleteAllXYSeries()
public void setCandlestickSeriesAppend(java.lang.String seriesName, double[] yopen, double[] yhigh, double[] ylow, double[] yclose) throws ChartException
seriesName
- Name of the series.yopen[]
- Array of values corresponding to the open observation.yhigh[]
- Array of values corresponding to the high observation.ylow[]
- Array of values corresponding to the low observation.yclose[]
- Array of values corresponding to the close observation.public void setOpenHiLoCloseSeriesAppend(java.lang.String seriesName, double[] yopen, double[] yhigh, double[] ylow, double[] yclose) throws ChartException
seriesName
- Name of the series.yopen[]
- Array of values corresponding to the open observation.yhigh[]
- Array of values corresponding to the high observation.ylow[]
- Array of values corresponding to the low observation.yclose[]
- Array of values corresponding to the close observation.public void setHiLoCloseSeriesAppend(java.lang.String seriesName, double[] yhigh, double[] ylow, double[] yclose) throws ChartException
seriesName
- Name of the series.yhigh[]
- Array of values corresponding to the high observation.ylow[]
- Array of values corresponding to the low observation.yclose[]
- Array of values corresponding to the close observation.public void setDeleteYSeries(java.lang.String seriesName) throws ChartException
seriesName
- Name of the series.setDeleteAllXYSeries()
,
setYSeriesAppend(String, double[])
,
setYSeriesSparseAppend(String, java.util.Date[], double[])
public void setDeleteAllYSeries()
public void setDeleteAllXYSeries()
setDeleteYSeries(String)
,
setYSeriesAppend(String, double[])
,
setYSeriesSparseAppend(String, java.util.Date[], double[])
public void setYSeriesSparseAppend(java.lang.String seriesName, java.util.Date[] tstamps, double[] yvalues) throws ChartException
seriesName
- Name of series.tstamps[]
- Array of java.util.Date.yvalues[]
- Double array of Y-axis values.AxisChart.setYSeriesSparse(java.lang.String, java.util.Date[], double[])
public void eraseChart()
public boolean getSeriesElementEntered(int x, int y)
x
- The screen x coordinate.y
- The screen y coordinate.getSeriesElementExited(int, int)
public boolean getSeriesElementExited(int x, int y)
x
- The screen x coordinate.y
- The screen y coordinate.getSeriesElementEntered(int, int)
public int getSeriesIndex(int x, int y)
getSeriesIndex is similar to getSeriesIndexDesc. Use getSeriesIndex for charts with a single series, and getSeriesIndexDesc when it is necessary to determine which of a number of series was selected.
x
- The screen x coordinate.y
- The screen y coordinate.getSeriesIndexDesc(int, int)
public SeriesDesc getSeriesIndexDesc(int x, int y)
This call is typically used in the context of mouse events in order to determine which series element has been selected.
x
- The screen x coordinate.y
- The screen y coordinate.getSeriesIndex(int, int)
public void setSeriesUnHighlight() throws ChartException
setSeriesHighlight(String, int, Color)
,
setSeriesUnHighlight(String)
public void setSeriesHighlight(java.lang.String seriesName, int seriesIndex, java.awt.Color c) throws ChartException
seriesName
- Name of series.seriesIndex
- Index identifying the series element.c
- Color to set series element.ChartException
- for an invalid series element index.setSeriesUnHighlight(String)
public void setSeriesUnHighlight(java.lang.String seriesName) throws ChartException
seriesName
- Name of series.setSeriesHighlight(String, int, Color)
public void setSeriesAnnotation(java.lang.String seriesName, int seriesIndex) throws ChartException
seriesName
- Name of series.seriesIndex
- Index identifying the series element.ChartException
- for an invalid series element index.setSeriesAnnotationRemove(String)
,
AxisChart.getAnnotationDesc()
,
AnnotationDesc
public void setSeriesAnnotationRemove(java.lang.String seriesName) throws ChartException
seriesName
- Name of series.setSeriesAnnotation(String, int)
public void setSeriesAnnotationRemove() throws ChartException
setSeriesAnnotation(String, int)
|
Chart Builder API (beta) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |