public class GFreeChartXY extends GComponent implements GDisplay, org.jfree.chart.ChartMouseListener, org.jfree.chart.labels.CrosshairLabelGenerator
Modifier and Type | Class and Description |
---|---|
static class |
GFreeChartXY.GAxis
Class represeint the a freechart axis with information about its type.
|
static class |
GFreeChartXY.GAxisType
Enumerate indicating the types of axis available for the GFreeChartXY.
|
static class |
GFreeChartXY.GFreeChartXYItem
Class defining an Item of the plot.
|
static class |
GFreeChartXY.GPlotPosition
Class to define the position of a point in a GFeeChartXYPlot in the corresponging axis.
|
static class |
GFreeChartXY.GSeriesProperties
Class to store the graphic plot properties to apply to the curves of a certain series.
|
static class |
GFreeChartXY.GToolTipGenerator
A tool tip generator that stores custom tooltips.
|
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
Modifier and Type | Field and Description |
---|---|
static double |
DEF_EPSILON
By default precision for interactive plots
|
NAME_ATTRIBUTE
Constructor and Description |
---|
GFreeChartXY(String chartTitle,
GFreeChartXY.GAxisType xAxisType,
GFreeChartXY.GAxisType yAxisType,
GFreeChartXY.GAxisType ySecondaryAxisType,
String xAxisTitle,
String yAxisTitle,
String secondaryYTitle,
boolean addLegends)
Create an empty chart.
|
GFreeChartXY(String chartTitle,
GFreeChartXY.GAxisType xAxisType,
GFreeChartXY.GAxisType yAxisType,
String xAxisTitle,
String yAxisTitle,
String secondaryYTitle,
boolean addLegends)
Create an empty chart.
|
GFreeChartXY(String widgetId,
String chartTitle,
GFreeChartXY.GAxisType xAxisType,
GFreeChartXY.GAxisType yAxisType,
GFreeChartXY.GAxisType ySecondaryAxisType,
String xAxisTitle,
String yAxisTitle,
String secondaryYTitle,
boolean addLegends)
Create an empty chart.
|
GFreeChartXY(String widgetId,
String chartTitle,
GFreeChartXY.GAxisType xAxisType,
GFreeChartXY.GAxisType yAxisType,
String xAxisTitle,
String yAxisTitle,
String secondaryYTitle,
boolean addLegends)
Create an empty chart.
|
GFreeChartXY(String chartTitle,
String xAxisTitle,
String yAxisTitle,
String secondaryYTitle,
boolean addLegends)
Create an empty chart.
|
GFreeChartXY(String widgetId,
String chartTitle,
String xAxisTitle,
String yAxisTitle,
String secondaryYTitle,
boolean addLegends)
Create an empty chart.
|
Modifier and Type | Method and Description |
---|---|
void |
addLegend(org.jfree.chart.title.LegendTitle legend)
Method to add a new legend
|
void |
addSerie(boolean useSecondaryYAxis,
GFreeChartXY.GSeriesProperties serieProperty,
org.jfree.data.xy.XYSeries serieDataSet)
Add a given series as either lines or points to the primary axis.
|
void |
addSerie(String serieName,
double[] xValueArray,
double[] yValueArray,
List<String> tooltipList,
Color color,
Shape shape)
Add a given series as either lines or points to the primary axis.
|
void |
addSerie(String serieName,
double[] xValueArray,
double[] yValueArray,
List<String> tooltipArray,
Color color,
Shape shape,
boolean useSecondaryYAxis,
Double xGapThreshold,
Double yGapThreshold)
Add a given series to a given plot as either lines or points.
|
void |
chartMouseClicked(org.jfree.chart.ChartMouseEvent event)
When the mouse button is clicked the last plot coordinates are stored so they can be
recovered
by the user.
|
void |
chartMouseMoved(org.jfree.chart.ChartMouseEvent event) |
void |
display()
Called when the element is to be displayed, so it can perform the actions required for its display, and
the display of its inmmediate descendants.
|
String |
generateLabel(org.jfree.chart.plot.Crosshair crosshair) |
org.jfree.chart.entity.ChartEntity |
getChartEntity()
Getter for the Chart Entity.
|
org.jfree.chart.ChartPanel |
getChartPanel()
Get the underlying chartPanel.
|
Component |
getComponent()
Returns the low level Swing Component encapsulated by the class if any, otherwise returns
null.
|
GFreeChartXY.GFreeChartXYItem |
getItemCoordinates()
Method to get the coordinates of a drawn point.
|
GFreeChartXY.GFreeChartXYItem |
getItemEvent()
Method to get the coordinates of a drawn point.
|
GFreeChartXY.GPlotPosition |
getLastClickPosition()
Returns the position of the last mouse click in plot coordinates.
|
GFreeChartXY.GFreeChartXYItem |
getPlaneCoordinates(boolean isSecondaryAxis)
Method to get the coordinates of the click regardless where the click is.
|
org.jfree.chart.plot.XYPlot |
getPlot()
Returns the chart plot.
|
GFreeChartXY.GSeriesProperties |
getSerieProperties(String serieName)
Get the properties of a curve
|
String |
getSubTitle()
Return the chart subtitle.
|
String |
getTitle()
Get the title of the plot.
|
GFreeChartXY.GAxis |
getXAxis()
Return X-axis.
|
org.jfree.data.xy.XYSeries |
getXYDataSet(String serieName,
boolean secondaryYAxis)
Get the XYSeries dataSet for a curve
|
GFreeChartXY.GAxis |
getYAxis()
Return Y-axis.
|
boolean |
isInteractive()
Method to know if the interactive mode is activated
|
void |
removeAllSeries()
Remove all the curves from the plot.
|
void |
removeLegend()
Method to remove the legend
|
void |
removeSeries(String serieName,
boolean secondaryYAxis)
Remove a curve from the plot.
|
void |
setColorSeries(String serieName,
boolean secondaryYAxis,
Color color)
Set the color of a curve.
|
void |
setEventTooltipList(List<String> tooltipList)
Setter for the tooltipList
|
void |
setForcedDrawLine(boolean forced)
Method to set if lines will be always drawn.
|
void |
setInteractive(boolean isInteractive)
Method to set the plot interactive or not
|
void |
setInteractivePrecision(double eps)
Method to set the precision for interactive plots
|
void |
setPlotGapThreshold(boolean secondaryPlot,
int series,
Double xGapThreshold,
Double yGapThreshold)
Set the gap thresholds.
|
void |
setSecondaryYAxeTitle(String title)
Set the title of the secondary y axis.
|
void |
setSeriesShape(String serieName,
boolean secondaryYAxis,
Shape shape)
Set the shape of a curve.
|
void |
setSubTitle(String subTitle)
Set the chart subtitle.
|
void |
setTitle(String title)
Set the title of the plot.
|
void |
setXAxeTitle(String title)
Set the title of the primary x axis.
|
void |
setXFormat(Format format)
Set the X axis format.
|
void |
setXTickInterval(Double tickInterval)
Set the X tick interval in axis units.
|
void |
setXZoom(Double minValue,
Double maxValue)
Sets the minimum and maximum value of the displayed X axis, if any of the zoom values is null
the zoom is reset.
|
void |
setYAxeTitle(String title)
Set the title of the primary y axis.
|
void |
setYFormat(boolean secondaryAxis,
Format format)
Set the Y axis format.
|
void |
setYTickInterval(boolean secondaryAxis,
Double tickInterval)
Set the Y tick interval in axis units.
|
void |
setYZoom(boolean secondaryAxis,
Double minValue,
Double maxValue)
Sets the minimum and maximum values of the displayed Y axis, if any of the zoom values is
null the zoom is reset.
|
void |
showChrossHair(boolean showCrosshair)
Method to show/hide the crosshair.
|
void |
showLegend(boolean show)
Show or hide the plot legend.
|
void |
showYSecondaryAxis(boolean showYSecondaryAxis)
Set the visibility of the secondary axis.
|
activateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getSubComponent, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isEnabled, isForcedStatus, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setEnabled, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public static final double DEF_EPSILON
public GFreeChartXY(String chartTitle, String xAxisTitle, String yAxisTitle, String secondaryYTitle, boolean addLegends)
chartTitle
- plot window title (can be null).xAxisTitle
- x Axis titles (can contain nulls, must be same length as yTitle).yAxisTitle
- y Axis titles (can contain nulls).secondaryYTitle
- secondary y Axis titles (can be null).addLegends
- true if series legends are wanted.public GFreeChartXY(String widgetId, String chartTitle, String xAxisTitle, String yAxisTitle, String secondaryYTitle, boolean addLegends)
widgetId
- widget identifier.chartTitle
- plot window title (can be null).xAxisTitle
- x Axis titles (can contain nulls, must be same length as yTitle).yAxisTitle
- y Axis titles (can contain nulls).secondaryYTitle
- secondary y Axis titles (can be null).addLegends
- true if series legends are wanted.public GFreeChartXY(String chartTitle, GFreeChartXY.GAxisType xAxisType, GFreeChartXY.GAxisType yAxisType, String xAxisTitle, String yAxisTitle, String secondaryYTitle, boolean addLegends)
chartTitle
- plot window title (can be null).xAxisType
- type of the X axis.yAxisType
- type of the Y axis.xAxisTitle
- x Axis titles (can contain nulls, must be same length as yTitle).yAxisTitle
- y Axis titles (can contain nulls).secondaryYTitle
- secondary y Axis titles (can be null).addLegends
- true if series legends are wanted.public GFreeChartXY(String widgetId, String chartTitle, GFreeChartXY.GAxisType xAxisType, GFreeChartXY.GAxisType yAxisType, String xAxisTitle, String yAxisTitle, String secondaryYTitle, boolean addLegends)
widgetId
- widget identifier.chartTitle
- plot window title (can be null).xAxisType
- type of the X axis.yAxisType
- type of the Y axis.xAxisTitle
- x Axis titles (can contain nulls, must be same length as yTitle).yAxisTitle
- y Axis titles (can contain nulls).secondaryYTitle
- secondary y Axis titles (can be null).addLegends
- true if series legends are wanted.public GFreeChartXY(String chartTitle, GFreeChartXY.GAxisType xAxisType, GFreeChartXY.GAxisType yAxisType, GFreeChartXY.GAxisType ySecondaryAxisType, String xAxisTitle, String yAxisTitle, String secondaryYTitle, boolean addLegends)
chartTitle
- plot window title (can be null).xAxisType
- type of the X axis.yAxisType
- type of the Y axis.ySecondaryAxisType
- type of the secondary Y axis.xAxisTitle
- x Axis titles (can contain nulls, must be same length as yTitle).yAxisTitle
- y Axis titles (can contain nulls).secondaryYTitle
- secondary y Axis titles (can be null).addLegends
- true if series legends are wanted.public GFreeChartXY(String widgetId, String chartTitle, GFreeChartXY.GAxisType xAxisType, GFreeChartXY.GAxisType yAxisType, GFreeChartXY.GAxisType ySecondaryAxisType, String xAxisTitle, String yAxisTitle, String secondaryYTitle, boolean addLegends)
widgetId
- widget identifier.chartTitle
- plot window title (can be null).xAxisType
- type of the X axis.yAxisType
- type of the Y axis.ySecondaryAxisType
- type of the secondary Y axis.xAxisTitle
- x Axis titles (can contain nulls, must be same length as yTitle).yAxisTitle
- y Axis titles (can contain nulls).secondaryYTitle
- secondary y Axis titles (can be null).addLegends
- true if series legends are wanted.public final void showChrossHair(boolean showCrosshair)
showCrosshair
- true if the crosshair shall be visible, false otherwise.public void setTitle(String title)
title
- title of the plot to set.public String getTitle()
public void setSubTitle(String subTitle)
subTitle
- the chart subtitle, in can be null.public String getSubTitle()
public void setXAxeTitle(String title)
title
- of the x axis. If the title is null the axis will be hidden.public void setYAxeTitle(String title)
title
- of the y axis. If the title is null the axis will be hidden.public final void setSecondaryYAxeTitle(String title)
title
- of the secondary axis.If the title is null the axis will be hidden.public void showYSecondaryAxis(boolean showYSecondaryAxis)
showYSecondaryAxis
- if true the secondary Y axis shall be displayed if defined, false
otehrwise.public void setPlotGapThreshold(boolean secondaryPlot, int series, Double xGapThreshold, Double yGapThreshold)
secondaryPlot
- true if the gaps apply to the secondary plot, false otherwise.series
- serie identifier.xGapThreshold
- Value of the threshold between X coordinates to avoid displaying the
segment, if null it is not used.yGapThreshold
- Value of the threshold between Y coordinates to avoid displaying the
segment, if null it is not used.public void addSerie(String serieName, double[] xValueArray, double[] yValueArray, List<String> tooltipArray, Color color, Shape shape, boolean useSecondaryYAxis, Double xGapThreshold, Double yGapThreshold) throws GFreeChartException
serieName
- series namexValueArray
- series abscissasyValueArray
- series ordinates (same length as x)tooltipArray
- tooltips for the elements of the series.color
- series color.shape
- series shape.useSecondaryYAxis
- true it the data-set shall be assigned to the secondary Y axis,
otherwise it is assigned to the primary.xGapThreshold
- treshold for the x gap.yGapThreshold
- treshold for the y gap.GFreeChartException
- If the xValueArray and yValueArray do not have the same
dimensions.public void addSerie(String serieName, double[] xValueArray, double[] yValueArray, List<String> tooltipList, Color color, Shape shape) throws GFreeChartException
serieName
- series namexValueArray
- series abscissasyValueArray
- series ordinates (same length as x)tooltipList
- tooltips for the elements of the series.color
- series color.shape
- series shape.GFreeChartException
- If the xValueArray and yValueArray do not have the same
dimensions.public void addSerie(boolean useSecondaryYAxis, GFreeChartXY.GSeriesProperties serieProperty, org.jfree.data.xy.XYSeries serieDataSet)
useSecondaryYAxis
- true it the data-set shall be assigned to the secondary Y axis,
otherwise it is assigned to the primary.serieProperty
- series propertiesserieDataSet
- series datasetpublic GFreeChartXY.GSeriesProperties getSerieProperties(String serieName)
serieName
- name of the curve.public org.jfree.data.xy.XYSeries getXYDataSet(String serieName, boolean secondaryYAxis)
serieName
- name of the curve.secondaryYAxis
- true if the curve is associated to the secondary axe, false otherwise.public void removeSeries(String serieName, boolean secondaryYAxis)
serieName
- name of the curve.secondaryYAxis
- true if the curve is associated to the secondary axe, false otherwise.public void removeAllSeries()
public void setColorSeries(String serieName, boolean secondaryYAxis, Color color)
serieName
- name of the curve.secondaryYAxis
- true if the curve is associated to the secondary axe, false otherwise.color
- new color of the curve.public void setSeriesShape(String serieName, boolean secondaryYAxis, Shape shape)
serieName
- name of the curvesecondaryYAxis
- true if the curve is associated to the secondary axe, false otherwise.shape
- new shape of the curvepublic void display()
public Component getComponent()
getComponent
in class GComponent
public org.jfree.chart.ChartPanel getChartPanel()
public final void showLegend(boolean show)
show
- flag to show or hide the legend.public final org.jfree.chart.plot.XYPlot getPlot()
public void setXZoom(Double minValue, Double maxValue)
minValue
- minimum value for the X axis.maxValue
- maximum value for the X axis.public void setYZoom(boolean secondaryAxis, Double minValue, Double maxValue)
secondaryAxis
- true if the minimum and max values shall be applied to the secondary
axis.minValue
- minimum value for the Y axis.maxValue
- maximum value for the Y axis.public void setXTickInterval(Double tickInterval)
tickInterval
- if null the tickInterval will be defined automatically by the plot, else
the value of units between 2 ticks.public void setYTickInterval(boolean secondaryAxis, Double tickInterval)
secondaryAxis
- true if the minimum and max values shall be applied to the secondary
axis.tickInterval
- if null the tickInterval will be defined automatically by the plot, else
the value of units between 2 ticks.public void setXFormat(Format format)
format
- formatter for the X axis.public void setYFormat(boolean secondaryAxis, Format format)
secondaryAxis
- true if the minimum and max values shall be applied to the secondary
axis.format
- formatter for the Y axis.public boolean isInteractive()
public void setInteractive(boolean isInteractive)
isInteractive
- plot will be interactive if truepublic void setInteractivePrecision(double eps)
eps
- precision (relative to the axis length)public void setForcedDrawLine(boolean forced)
forced
- lines will be always drawn if truepublic void removeLegend()
public void addLegend(org.jfree.chart.title.LegendTitle legend)
legend
- new legendpublic GFreeChartXY.GFreeChartXYItem getPlaneCoordinates(boolean isSecondaryAxis)
isSecondaryAxis
- We consider secondary axis unitspublic GFreeChartXY.GFreeChartXYItem getItemCoordinates()
public GFreeChartXY.GFreeChartXYItem getItemEvent()
public void chartMouseClicked(org.jfree.chart.ChartMouseEvent event)
chartMouseClicked
in interface org.jfree.chart.ChartMouseListener
public void chartMouseMoved(org.jfree.chart.ChartMouseEvent event)
chartMouseMoved
in interface org.jfree.chart.ChartMouseListener
public void setEventTooltipList(List<String> tooltipList)
tooltipList
- tool tip listpublic org.jfree.chart.entity.ChartEntity getChartEntity()
public GFreeChartXY.GPlotPosition getLastClickPosition()
public String generateLabel(org.jfree.chart.plot.Crosshair crosshair)
generateLabel
in interface org.jfree.chart.labels.CrosshairLabelGenerator
public GFreeChartXY.GAxis getXAxis()
public GFreeChartXY.GAxis getYAxis()
Copyright © 2024. All rights reserved.