|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--com.jinsight.jetchart.GradientPanel | +--com.jinsight.jetchart.GenericGraph | +--com.jinsight.jetchart.Graph
The Graph class implements the graphic context of series whose data points are plotted
against only one scale and follow a regular progression along the horizontal or vertical
axis, if chart is vertical or horizontal respectively. Each series data point is
associated with a descriptive label.
A chart context implemented by the Graph class can be dragged or resized. To drag a chart,
just place the mouse cursor within the chart area, then click and drag.
To resize chart, double-click mouse within the chart area and then click and drag.
A double-click alternates between dragging and resizing chart.
GenericGraph
,
AbstractSerie
,
GenericGraph.setDraggingEnabled(boolean)
, Serialized FormInner classes inherited from class java.awt.Panel |
java.awt.Panel.AccessibleAWTPanel |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
static int |
DAY_INCREMENT
Constant used to set the date increment of a date chart to a daily increment. |
static int |
GRAPH_AREA
Constant used to clip the background area within which an image can be painted or the gradient colors effect can be displayed. |
static int |
GRAPH_SCOPE
Constant used to specify that the shift value of a series must be calculated with respect to the number of series added to the chart context, rather than the GraphSet object they belong to. |
static int |
GRAPHSET_SCOPE
Constant used to specify that the shift value of a series must be calculated with respect to the number of series belonging to the same GraphSet object. |
static int |
HIGH
Constant used to set multiple tooltips mouse sensitivity to high. |
static int |
LOW
Constant used to set multiple tooltips mouse sensitivity to low. |
static int |
MEDIUM
Constant used to set multiple tooltips mouse sensitivity to medium. |
static int |
MONTH_INCREMENT
Constant used to set the date increment of a date chart to a monthly increment. |
static int |
PARENT_AREA
Constant used to set the chart container bounds to the area within which a background image can be painted or the gradient colors effect can be displayed. |
static int |
WEEK_INCREMENT
Constant used to set the date increment of a date chart to a weekly increment. |
static int |
YEAR_INCREMENT
Constant used to set the date increment of a date chart to a yearly increment. |
Fields inherited from class com.jinsight.jetchart.GenericGraph |
CENTER, TILE, TOP_LEFT |
Fields inherited from class com.jinsight.jetchart.GradientPanel |
BOTTOM_TO_TOP, LEFT_TO_RIGHT, RIGHT_TO_LEFT, TOP_TO_BOTTOM |
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 | |
Graph()
Creates a Graph object. |
|
Graph(java.lang.String[] labels)
Creates a Graph object, taking the chart labels as an array of strings. |
Method Summary | |
void |
addGraphSet(GraphSet graphSet)
Adds a GraphSet object to the chart context. |
void |
addSerie(AbstractSerie serie)
Adds series objects to the chart context. |
void |
addZoomListener(ZoomListener zoomListener)
Adds a zoom event listener to handle zoom events. |
protected void |
finalize()
|
GraphEventListener |
getGraphEventListener()
Returns a reference to a GraphEventListener object. |
GraphSet |
getGraphSet(int graphSetIndex)
Gets a reference to a GraphSet object previously added to the chart context. |
java.lang.String[] |
getLabels()
Returns the chart labels. |
ScrollingLabel |
getScrollingLabel()
Returns a reference to the ScrollingLabel object. |
Wall |
getWall()
Returns a reference to a Wall object. |
boolean |
isDrawingTrendLine()
If a trendline is being drawed this method returns true. |
boolean |
isHorizontalGraphEnabled()
Returns true if chart orientation is horizontal. |
void |
paint(java.awt.Graphics gr)
Overrides the Component class paint() method. |
void |
readXMLData(java.io.Reader reader)
Reads chart properties from an xml character stream. |
void |
refresh()
Refreshes chart. |
void |
removeAllSeries()
Removes all series from the graphic context. |
void |
removeAllTrendLines()
Removes all GraphSets' trendlines. |
void |
removeGraphSet(GraphSet graphSet)
Removes a GraphSet object from the chart context. |
void |
removeSerie(AbstractSerie serie)
Removes a series from the graphic context. |
void |
removeZoomListener(ZoomListener zoomListener)
Removes a zoom event listener. |
void |
set3DSeriesInLineEnabled(boolean is3DSeriesInLineEnabled)
Enables/disables inline disposition of series in 3D charts. |
void |
setAutoLabelSpacingEnabled(boolean isAutoLabelSpacingEnabled)
Enables/disables automatic label spacing. |
void |
setAutoScalePositioningEnabled(boolean isAutoScalePositioningEnabled)
Enables/disables automatic scale positioning, in vertical charts. |
void |
setBackgroundImageArea(int backgroundImageArea)
Sets the area where a background image is painted. |
void |
setDataSetRange(int dataSetStartIndex,
int dataSetEndIndex)
Delimits a range of data points to be plotted. |
void |
setDateIncrement(int dateIncrementType)
Sets date increment type as a daily, weekly, monthly or yearly increment. |
void |
setDateIncrement(int dateIncrementType,
int dateIncrement)
Sets date increment type as a daily, weekly, monthly or yearly increment. |
void |
setGradientColorsArea(int gradientColorsArea)
Sets the area where the gradient colors effect is displayed. |
void |
setHDepth(int hDepth)
Sets horizontal chart 3D depth. |
void |
setHorizontalGraphEnabled(boolean isHorizontalGraphEnabled)
Enables/disables horizontal chart. |
void |
setLabels(java.lang.String[] labels)
Sets chart labels. |
void |
setLabels(java.lang.String[] labels,
int offset,
int len)
Sets chart labels. |
void |
setLabelsAxisEndGap(int labelsAxisEndGap)
Sets the labels axis end gap. |
void |
setLabelsAxisStartGap(int labelsAxisStartGap)
Sets the labels axis start gap. |
void |
setLabelSections(int labelSections)
Deprecated. |
void |
setLabelsFont(java.awt.Font labelsFont)
Sets the labels font. |
void |
setLabelsQuery(java.lang.String labelsQuery)
Sets a sql statement to access a database and get chart labels. |
void |
setLabelsStatus(int[] labelsStatus)
Sets labels status. |
void |
setLabelsStep(int labelsStep)
Sets a step value to control labels painting. |
void |
setMonthLabelsEnabled(boolean isMonthLabelsEnabled)
Enables/disables automatic display of labels as months, if a starting date is informed and labels are not retrieved from a database. |
void |
setMouseSensitivity(int mouseSensitivity)
Sets mouse sensitivity. |
void |
setMultipleHighlightEnabled(boolean isMultipleHighlightEnabled)
Enables/disables simultaneous highlight of data points. |
void |
setMultipleSerieEventsEnabled(boolean isMultipleSerieEventsEnabled)
Enables/disables simultaneous dispatch of series events. |
void |
setScalesGap(float scalesGap)
Sets the gap between stacked scales, in vertical charts. |
void |
setSerieDraggingEnabled(boolean isSerieDraggingEnabled)
Enables/disables series dragging. |
void |
setSeriesTitleShiftScope(int seriesTitleShiftScope)
Sets the series title shift scope. |
void |
setShiftScope(int shiftScope)
Sets the scope to be taken into account when calculating the shift value of bar and stacked bar series. |
void |
setStartDate(java.lang.String startDate)
Sets a starting date to generate date labels. |
void |
setStartDate(java.lang.String startDate,
int offset)
Sets a starting date to generate date labels. |
void |
setTrendLineColor(java.awt.Color trendLineColor)
Sets the color of the line displayed while drawing a trendline. |
void |
setTrendLinesDrawingEnabled(boolean isTrendLinesDrawingEnabled)
Enables/disables manual drawing of trendlines. |
void |
setVDepth(int vDepth)
Sets vertical chart 3D depth. |
void |
setVerticalLabelsEnabled(boolean isVerticalLabelsEnabled)
Enables/disables vertical orientation of labels. |
void |
setVerticalLabelsOpacityEnabled(boolean isVerticalLabelsOpaque)
Enables/disables vertical labels opacity. |
void |
setZoomAreaColor(java.awt.Color zoomAreaColor)
Sets the color to paint chart area selected for zooming. |
void |
setZoomAreaSplitEnabled(boolean isZoomAreaSplit)
Provides control over the way the zoom area is selected. |
void |
setZoomEnabled(boolean isZoomEnabled)
Enables/disables zoom. |
void |
update(java.awt.Graphics gr)
Overrides the Component class update() method,
to avoid flickering. |
Methods inherited from class com.jinsight.jetchart.GradientPanel |
setGradientColors, setGradientOrientation |
Methods inherited from class java.awt.Panel |
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int DAY_INCREMENT
public static final int WEEK_INCREMENT
public static final int MONTH_INCREMENT
public static final int YEAR_INCREMENT
public static final int LOW
public static final int MEDIUM
public static final int HIGH
public static final int GRAPHSET_SCOPE
public static final int GRAPH_SCOPE
public static final int PARENT_AREA
public static final int GRAPH_AREA
Constructor Detail |
public Graph()
public Graph(java.lang.String[] labels)
labels
- Array of strings.AbstractSerie.setValues(double[])
Method Detail |
public void addSerie(AbstractSerie serie)
GenericGraph
Only series belonging to the same type of chart context can be combined. For example, a line series can be combined with another line series, a bar series, an area series, etc., but can not be combined with an xy series, whose chart context is ScatterGraph.
addSerie
in class GenericGraph
com.jinsight.jetchart.GenericGraph
serie
- Any series that extends the AbstractSerie class.AbstractSerie
,
GraphException
public void removeSerie(AbstractSerie serie)
GenericGraph
removeSerie
in class GenericGraph
com.jinsight.jetchart.GenericGraph
serie
- Any series that extends the AbstractSerie class and that was previously added
to the chart context.AbstractSerie
public void removeAllSeries()
GenericGraph
removeAllSeries
in class GenericGraph
public void addGraphSet(GraphSet graphSet)
graphSet
- A GraphSet object.GraphSet
public void removeGraphSet(GraphSet graphSet)
graphSet
- A GraphSet object.GraphSet
public GraphSet getGraphSet(int graphSetIndex)
graphSetIndex
- An integer number.GraphSet
public void addZoomListener(ZoomListener zoomListener)
zoomListener
- A ZoomListener object.removeZoomListener(com.jinsight.jetchart.ZoomListener)
,
ZoomListener
,
ZoomEvent
public void removeZoomListener(ZoomListener zoomListener)
zoomListener
- A ZoomListener object.addZoomListener(com.jinsight.jetchart.ZoomListener)
,
ZoomListener
,
ZoomEvent
public GraphEventListener getGraphEventListener()
GraphEventListener
public void setAutoLabelSpacingEnabled(boolean isAutoLabelSpacingEnabled)
isAutoLabelSpacingEnabled
- A boolean value.public void setTrendLinesDrawingEnabled(boolean isTrendLinesDrawingEnabled)
isTrendLinesDrawingEnabled
- A boolean value.GraphSet.setTrendLinesColor(java.awt.Color)
,
GraphSet.setTrendLinesThickness(int)
public void setTrendLineColor(java.awt.Color trendLineColor)
trendLineColor
- A Color object.setTrendLinesDrawingEnabled(boolean)
public boolean isDrawingTrendLine()
setTrendLinesDrawingEnabled(boolean)
public void removeAllTrendLines()
GraphSet.removeAllTrendLines()
public void readXMLData(java.io.Reader reader) throws java.io.IOException
GenericGraph
readXMLData
in class GenericGraph
com.jinsight.jetchart.GenericGraph
reader
- The reader from which to retrieve the XML data.java.io.IOException
- If an error occured while reading the input.GraphException
- If the XML data does not follow certain rules related to the definition
of acceptable tags.AbstractSerie.getId()
public Wall getWall()
Wall
,
GraphSet
,
GraphSet.getWall()
public void setAutoScalePositioningEnabled(boolean isAutoScalePositioningEnabled)
isAutoScalePositioningEnabled
- A boolean value (true/false)GraphSet
,
Scale.setStartPoint(float)
,
Scale.setEndPoint(float)
,
setScalesGap(float)
public void setScalesGap(float scalesGap)
scalesGap
- A float number.setAutoScalePositioningEnabled(boolean)
,
Scale.setStartPoint(float)
,
Scale.setEndPoint(float)
public void setShiftScope(int shiftScope)
setAutoScalePositioningEnabled
or manually setting the start and end points of all scales so that they do not
overlap.shiftScope
- An integer number.GRAPH_SCOPE
,
GRAPHSET_SCOPE
,
GraphSet
public void setSeriesTitleShiftScope(int seriesTitleShiftScope)
seriesTitleShiftScope
- An integer number.GRAPH_SCOPE
,
GRAPHSET_SCOPE
,
GraphSerie.setTitlePosition(int)
,
GraphSet
public void setLabelsQuery(java.lang.String labelsQuery)
setLabels
or the Graph.setStartDate
methods. The query must return only one column, otherwise an exception is
raised.setLabelsQuery
in class GenericGraph
labelsQuery
- A sql statement.GenericGraph.setDriver(java.lang.String)
,
GenericGraph.setConnection(java.lang.String, java.lang.String, java.lang.String)
,
setLabels(java.lang.String[])
,
setStartDate(java.lang.String)
public void setLabels(java.lang.String[] labels)
labels
- An array of strings.public void setLabels(java.lang.String[] labels, int offset, int len)
labels
- An array of strings.offset
- The start offset.len
- The maximum number of labels read.addSerie(com.jinsight.jetchart.AbstractSerie)
,
AbstractSerie.setValues(double[])
public java.lang.String[] getLabels()
public void setLabelsFont(java.awt.Font labelsFont)
labelsFont
- A Font object.public void setLabelSections(int labelSections)
setLabelsStatus
to
control visibility of each label or setLabelsStep
to define
a step value.setLabelsStatus(int[])
,
setLabelsStep(int)
public void setLabelsStep(int labelsStep)
labelsStep
- An integer value equal to or greater than 1.setAutoLabelSpacingEnabled(boolean)
public void setLabelsStatus(int[] labelsStatus)
labelsStatus
- An integer array of binary values(0 or 1).setLabels(java.lang.String[])
public void setLabelsAxisStartGap(int labelsAxisStartGap)
labelsAxisStartGap
- An integer number.public void setLabelsAxisEndGap(int labelsAxisEndGap)
labelsAxisEndGap
- An integer number.public void setSerieDraggingEnabled(boolean isSerieDraggingEnabled)
After releasing mouse button the scale is recalculated so that data points dragged past the chart bounds are always displayed within a visible area.
isSerieDraggingEnabled
- A boolean value(true/false).SerieEvent
,
SerieListener
,
refresh()
,
setHorizontalGraphEnabled(boolean)
,
GenericGraph.addSerieListener(com.jinsight.jetchart.SerieListener)
public void setZoomEnabled(boolean isZoomEnabled)
isZoomEnabled
- A boolean value(true/false).GenericGraph.setDraggingEnabled(boolean)
,
setZoomAreaColor(java.awt.Color)
,
setZoomAreaSplitEnabled(boolean)
public void setZoomAreaColor(java.awt.Color zoomAreaColor)
zoomAreaColor
- A Color object.setZoomEnabled(boolean)
,
setZoomAreaSplitEnabled(boolean)
public void setZoomAreaSplitEnabled(boolean isZoomAreaSplit)
GraphSet
,
setZoomEnabled(boolean)
public void setStartDate(java.lang.String startDate)
startDate
- A String object.setDateIncrement(int)
public void setStartDate(java.lang.String startDate, int offset)
startDate
- A string object.offset
- An integer number.setDateIncrement(int)
public void setDateIncrement(int dateIncrementType)
dateIncrementType
- one of the constants used to set the date increment.DAY_INCREMENT
,
WEEK_INCREMENT
,
MONTH_INCREMENT
,
YEAR_INCREMENT
public void setDateIncrement(int dateIncrementType, int dateIncrement)
dateIncrementType
- one of the constants used to set the date increment.dateIncrement
- an integer number.DAY_INCREMENT
,
WEEK_INCREMENT
,
MONTH_INCREMENT
,
YEAR_INCREMENT
public void setMonthLabelsEnabled(boolean isMonthLabelsEnabled)
setDateIncrement(int dateIncrementType,
int dateIncrement)
method.isMonthLabelsEnabled
- A boolean valuesetStartDate(java.lang.String)
,
setDateIncrement(int)
public void setMultipleHighlightEnabled(boolean isMultipleHighlightEnabled)
setMouseSensitivity
method.isMultipleHighlightEnabled
- A boolean value(true/false).setMouseSensitivity(int)
public void setMultipleSerieEventsEnabled(boolean isMultipleSerieEventsEnabled)
If data points values must be displayed in a way different from tooltips,
like Labels laid out on a Panel, for example, set this method to true and
capture data points values by handling series events with the
mouseMoved
method, which is a method required by the
SerieListener interface.
Series events are also dispatched if a data point is clicked, released or dragged. However, this method only affects the dispatch of events as a result of mouse moving.
isMultipleSerieEventsEnabled
- a boolean value(true/false).SerieEvent
,
SerieListener
,
GenericGraph.addSerieListener(com.jinsight.jetchart.SerieListener)
,
setMouseSensitivity(int)
public void setMouseSensitivity(int mouseSensitivity)
mouseSensitivity
- One of the constants used to set mouse sensitivity.HIGH
,
MEDIUM
,
LOW
,
ToolTip.setMultipleEnabled(boolean)
,
setMultipleHighlightEnabled(boolean)
,
setMultipleSerieEventsEnabled(boolean)
,
ScrollingBar
,
ScrollingLabel
public void setVDepth(int vDepth)
vDepth
- An int number representing vertical depth.GenericGraph.set3DEnabled(boolean)
public void setHDepth(int hDepth)
hDepth
- An int number representing horizontal depth.GenericGraph.set3DEnabled(boolean)
public void setHorizontalGraphEnabled(boolean isHorizontalGraphEnabled)
isHorizontalGraphEnabled
- A boolean value(true/false).public boolean isHorizontalGraphEnabled()
setHorizontalGraphEnabled(boolean)
public void set3DSeriesInLineEnabled(boolean is3DSeriesInLineEnabled)
is3DSeriesInLineEnabled
- A boolean value(true/false).public void setVerticalLabelsEnabled(boolean isVerticalLabelsEnabled)
isVerticalLabelsEnabled
- A boolean value(true/false).public void setVerticalLabelsOpacityEnabled(boolean isVerticalLabelsOpaque)
isVerticalLabelsOpaque
- A boolean value(true/false).public ScrollingLabel getScrollingLabel()
ScrollingLabel
public void setDataSetRange(int dataSetStartIndex, int dataSetEndIndex)
dataSetStartIndex
- An integer numberdataSetEndIndex
- An integer numbersetLabels(java.lang.String[])
,
setLabelsStatus(int[])
,
setStartDate(java.lang.String)
,
setMonthLabelsEnabled(boolean)
,
GraphSerie.setValues(double[])
,
GraphSerie.setMultipleValues(double[][])
,
GraphSerie.setValuesQuery(java.lang.String)
,
addSerie(com.jinsight.jetchart.AbstractSerie)
,
removeSerie(com.jinsight.jetchart.AbstractSerie)
,
removeAllSeries()
,
ZoomListener
,
ZoomEvent
public void setBackgroundImageArea(int backgroundImageArea)
backgroundImageArea
- An integer value.PARENT_AREA
,
GRAPH_AREA
public void setGradientColorsArea(int gradientColorsArea)
gradientColorsArea
- An integer value.PARENT_AREA
,
GRAPH_AREA
public void refresh()
refresh
in class GenericGraph
public void update(java.awt.Graphics gr)
update()
method,
to avoid flickering.update
in class java.awt.Container
gr
- A Graphics object, where painting is done. This
object is automatically created by the AWT classes and passed
to the update()
method, which in turn sends it
to the paint()
method.paint(java.awt.Graphics)
public void paint(java.awt.Graphics gr)
paint()
method.
Chart plotting starts in this method, basically
by delegating the painting process to each one of the
objects held by the chart context.paint
in class GradientPanel
gr
- A Graphics object.update(java.awt.Graphics)
protected void finalize() throws java.lang.Throwable
finalize
in class GenericGraph
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |