Class LineGraph
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.shape.RMShape
com.inductiveautomation.factorypmi.plugins.reporting.shapes.LineGraph
- All Implemented Interfaces:
- RMArchiver.Archiving,- Java2DShapePainter,- RMShapePainter.Paint,- Cloneable
The RMGraph class provides a template and the machinery for generating graphs. It primarily encapsulates a list key
 for defining the set of objects to graph and a keys string for defining the attributes of those objects to graph. For
 instance, the list key might be "Movies" and the keys string might be "revenue". You can programatically create a
 graph like this:
 
RMGraph graph = new RMGraph(); graph.setBounds(0, 0, 640, 480); graph.setListKey("Movies"); graph.setKeysString("revenue"); graph.setType(RMGraph.TYPE_PIE);
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final String[]Fields inherited from class com.reportmill.shape.RMShapeWRAP_TYPE_BOTH, WRAP_TYPE_NONE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanRMEditor method (indicates that graphs have settable format).voidbasePaint(Graphics2D g, Rectangle2D rect) voidvoidCopies the attributes from the given object into receiver (for undo).dateValueForKeyChain(Object anObj, Object aKey) Returns a date value for the given object and key (automatically handles "swapped" case).doubledoubleValueForKeyChain(Object anObj, Object aKey) Returns a double value for the given object and key (automatically handles "swapped" case).booleanStandard equals implementation.fromXML(RXArchiver anArchiver, RXElement anElement) XML unarchival.Returns the value axis' min, max and number of increments as a single string.getColor(int anIndex) Returns the specific color at the given index.intReturns the number of colors set for this graph.Returns the list of colors to be used by this graph (or the default graph colors, if null).static ListReturns the default list of colors to be used by any graph without an explicit list of colors.booleanReturns whether the graph draws in 3D.Returns the optional key chain (expression) used to limit the table list derived from list key.getFont()Returns the font associated with the graph.Returns the format associated with the value axis of the graph.Returns the graph type as a simple string: bar, pie or hbar.Returns the keys to be graphed (unless swapped, in which case it returns the objects).getKeys()Returns a list of the individual keys in the (potentialy) comma separated keys string.Returns keys string - a comma separated list of keys evaluated on list key objects to represent in graph.Returns the list key associated with the graph.Returns the objects to be graphed (unless swapped, in which case it returns the keys).booleanReturns whether the graph shows a legend.getSort(int anIdex) Returns the individual RMSort at the given index.intReturns the number of sorts associated with this graph.getSorts()Returns the list of sorts associated with the graph.booleanReturns whether the graph groups bars by keys (normal) or by objects (swapped).Editor method - returns the tool class name for this shape.getType()Returns the graph type (TYPE_LINE, TYPE_AREA, etc.).booleanbooleanbooleanvoidpaintShape(RMShapePainter aPainter, Graphics2D g) rpgClone(ReportMill aReportMill) Returns a clone of this shape with report generation.voidsetAxisMinMaxCount(String aValue) Sets the value axis' min, max and number of increments as a single string.voidSets the list of colors to be used by this graph.static voidsetDefaultColors(List aList) Sets the default list of colors to be used by any graph without an explicit list of colors.voidsetDraw3D(boolean aFlag) Sets whether the graph draws in 3D.voidsetFilterKey(String aKeyExpr) Returns the optional key chain (expression) used to limit the table list derived from list key.voidSets the font associated with the graph.voidSets the format associated with the value axis of the graph.voidsetGraphTypeString(String aString) Sets the graph type as a simple string: bar, pie or hbar.voidsetKeysString(String aString) Sets keys string - a comma separated list of keys evaluated on list key objects to represent in graph.voidsetListKey(String aKeyPath) Sets the list key associated with the graph.voidsetShowLegend(boolean aFlag) Sets whether the graph shows a legend.voidsetShowXAxis(boolean axis) voidsetShowYAxis(boolean axis) voidsetSwapSeries(boolean aFlag) Sets whether the graph groups bars by keys (normal) or by objects (swapped).voidsetTimeseries(boolean timeseries) voidSets the graph type (TYPE_LINE, TYPE_AREA, etc.).voidsetXAxisLabel(String axisLabel) voidsetYAxisLabel(String axisLabel) toXML(RXArchiver anArchiver) XML archival.Methods inherited from class com.reportmill.shape.RMShapeacceptsChildren, acceptsDragKeys, acceptsMouse, addChild, addChild, addChildBelowLastChild, bounds, boundsChanged, boundsChanged, bringShapesToFront, canBeUngrouped, childrenSuperSelectImmediately, clone, cloneDeep, contains, convertedPointFromShape, convertedPointToShape, convertedRectFromShape, convertedRectToShape, convertedSizeFromShape, convertedSizeToShape, convertedVectorFromShape, convertedVectorToShape, convertFromShape, convertPathFromShape, convertPathToShape, convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, convertSizeFromShape, convertSizeToShape, convertToShape, convertVectorFromShape, convertVectorToShape, copyShape, delete, didChange, divideShapeFromEdge, divideShapeFromTop, dragExit, dragKeyAtPoint, dropKeyAtPoint, fromXMLDeep, get, getActionScript, getAnim, getAnim, getAnimator, getAnimator, getAutosizeHeight, getAutosizing, getBounds, getBoundsInside, getBoundsMarked, getBoundsOfChildren, getBoundsOfChildren, getBoundsSuperSelected, getCausesWrap, getCausesWrapType, getChild, getChildAnimator, getChildAnimator, getChildContaining, getChildCount, getChildLast, getChildren, getChildrenIntersecting, getChildrenWhoCauseWrap, getChildrenWhoDraw, getChildrenWhoHitTest, getChildSortedByX, getChildWithClass, getChildWithName, getColor, getCommonAncestor, getDocument, getFill, getFill, getFill, getFillCount, getFills, getFrame, getFrame, getFrameMaxX, getFrameMaxY, getFrameX, getFrameXY, getFrameY, getGroupShape, getHeight, getHeightToFit, getImageFill, getLineWidth, getListKeyDeep, getListKeyShape, getMaxX, getMaxY, getName, getOpacity, getOpacityDeep, getOutline, getPageCount, getPageShape, getParent, getParentCount, getParents, getPath, getPathInBounds, getPropertyKey, getPropertyKeyCount, getPropertyKeyName, getRoll, getRootShape, getScaleX, getScaleY, getShapesToAncestor, getShapesToDescendant, getShapesToShape, getSize, getSizeP, getSkewX, getSkewY, getStroke, getStrokeColor, getTextColor, getTransform, getTransformFromShape, getTransformInverse, getTransformToShape, getUndoer, getUrl, getWidth, getWidthToFit, getX, getXY, getXYP, getY, groupShapes, hasPageBreaks, height, indexOf, indexOf, initWithArchiver, intersects, isAncestor, isDescendant, isLocked, isRoot, isUnderlined, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, notRSS, offsetChildrenXY, offsetXY, page, pageBreakMax, pageBreakPageMax, pageMax, put, putPropertyKey, reclaimChildren, removeChild, removeChild, removeChildren, removeChildren, removeFromParent, resolvePageReferences, rpgCloneBase, rpgCloneChildren, rpgCloneConclude, rpgCloneNotification, rpgClonePrepare, rpgClonePreprocess, rpgCloneUrl, sendShapesToBack, setActionScript, setAnim, setAutosizeHeight, setAutosizing, setBounds, setBounds, setCausesWrapType, setChildren, setColor, setFill, setFrame, setFrame, setFrameSize, setFrameX, setFrameXY, setFrameXY, setFrameY, setHeight, setHeightDeep, setHeightDeep, setHeightToFit, setLineWidth, setLocked, setName, setNeedsRepaint, setNeedsRepaint, setOpacity, setOutline, setParent, setRoll, setScaleX, setScaleXY, setScaleY, setSize, setSize, setSizeDeep, setSizeP, setSizeToFit, setSizeToFit, setSkewX, setSkewXY, setSkewY, setStroke, setStrokeColor, setTextColor, setTime, setUnderlined, setUrl, setWidth, setWidthDeep, setWidthDeep, setWidthToFit, setX, setXY, setXY, setXYP, setY, sizesToFitChildren, superSelectable, toString, undoClone, undoCopy, undoEquals, undoerAddDirtyObject, undoerDisable, undoerEnable, undoerSetUndoTitle, width, willChange, willChange, x, yMethods inherited from class com.reportmill.base.RMObjectdidUndo, getAnimAttribute, getClassNameShort
- 
Field Details- 
TYPE_LINE- See Also:
 
- 
TYPE_AREA- See Also:
 
- 
TYPE_SCATTER- See Also:
 
- 
TYPES
 
- 
- 
Constructor Details- 
LineGraphpublic LineGraph()Creates a plain graph shape.
 
- 
- 
Method Details- 
buildChartpublic void buildChart()
- 
getListKeyReturns the list key associated with the graph.- Overrides:
- getListKeyin class- RMShape
 
- 
setListKeySets the list key associated with the graph.- Overrides:
- setListKeyin class- RMShape
 
- 
getFilterKeyReturns the optional key chain (expression) used to limit the table list derived from list key.
- 
setFilterKeyReturns the optional key chain (expression) used to limit the table list derived from list key.
- 
getKeysStringReturns keys string - a comma separated list of keys evaluated on list key objects to represent in graph.
- 
setKeysStringSets keys string - a comma separated list of keys evaluated on list key objects to represent in graph.
- 
getKeysReturns a list of the individual keys in the (potentialy) comma separated keys string.
- 
getTypeReturns the graph type (TYPE_LINE, TYPE_AREA, etc.).
- 
setTypeSets the graph type (TYPE_LINE, TYPE_AREA, etc.).
- 
getGraphTypeStringReturns the graph type as a simple string: bar, pie or hbar.
- 
setGraphTypeStringSets the graph type as a simple string: bar, pie or hbar.
- 
getSortCountpublic int getSortCount()Returns the number of sorts associated with this graph.
- 
getSortReturns the individual RMSort at the given index.
- 
getSortsReturns the list of sorts associated with the graph.
- 
getDraw3Dpublic boolean getDraw3D()Returns whether the graph draws in 3D.
- 
setDraw3Dpublic void setDraw3D(boolean aFlag) Sets whether the graph draws in 3D.
- 
getSwapSeriespublic boolean getSwapSeries()Returns whether the graph groups bars by keys (normal) or by objects (swapped).
- 
setSwapSeriespublic void setSwapSeries(boolean aFlag) Sets whether the graph groups bars by keys (normal) or by objects (swapped).
- 
getAxisMinMaxCountReturns the value axis' min, max and number of increments as a single string.
- 
setAxisMinMaxCountSets the value axis' min, max and number of increments as a single string.
- 
getShowLegendpublic boolean getShowLegend()Returns whether the graph shows a legend.
- 
setShowLegendpublic void setShowLegend(boolean aFlag) Sets whether the graph shows a legend.
- 
getColorCountpublic int getColorCount()Returns the number of colors set for this graph.
- 
getColorReturns the specific color at the given index.
- 
getColorsReturns the list of colors to be used by this graph (or the default graph colors, if null).
- 
setColorsSets the list of colors to be used by this graph.
- 
getDefaultColorsReturns the default list of colors to be used by any graph without an explicit list of colors.
- 
setDefaultColorsSets the default list of colors to be used by any graph without an explicit list of colors.
- 
getFontReturns the font associated with the graph.
- 
setFontSets the font associated with the graph.
- 
getFormatReturns the format associated with the value axis of the graph.
- 
setFormatSets the format associated with the value axis of the graph.
- 
acceptsFormatpublic boolean acceptsFormat()RMEditor method (indicates that graphs have settable format).- Overrides:
- acceptsFormatin class- RMShape
 
- 
equalsStandard equals implementation.
- 
copyCopies the attributes from the given object into receiver (for undo).
- 
toXMLXML archival.
- 
fromXMLXML unarchival.
- 
paintShape- Specified by:
- paintShapein interface- RMShapePainter.Paint
 
- 
basePaint- Specified by:
- basePaintin interface- Java2DShapePainter
 
- 
rpgCloneReturns a clone of this shape with report generation.
- 
getGroupsReturns the keys to be graphed (unless swapped, in which case it returns the objects).
- 
getSeriesReturns the objects to be graphed (unless swapped, in which case it returns the keys).
- 
doubleValueForKeyChainReturns a double value for the given object and key (automatically handles "swapped" case).
- 
dateValueForKeyChainReturns a date value for the given object and key (automatically handles "swapped" case).
- 
getToolClassNameDescription copied from class:RMShapeEditor method - returns the tool class name for this shape.- Overrides:
- getToolClassNamein class- RMShape
 
- 
isShowXAxispublic boolean isShowXAxis()
- 
setShowXAxispublic void setShowXAxis(boolean axis) 
- 
isShowYAxispublic boolean isShowYAxis()
- 
setShowYAxispublic void setShowYAxis(boolean axis) 
- 
isTimeseriespublic boolean isTimeseries()
- 
setTimeseriespublic void setTimeseries(boolean timeseries) 
- 
getXAxisLabel
- 
setXAxisLabel
- 
getYAxisLabel
- 
setYAxisLabel
 
-