Provide functions to display and populate line charts.
This module depends on following other modules which will automatically be loaded.
Method | Description |
---|---|
addMarker() | Add a marker to the chart. |
axis() | Alias for setAxisRange(). |
clear() | Clears the active chart. |
createChart() | Create a new chart on a given parent composite. |
exportGraph() | Export the current figure as png file. |
figure() | Opens a new view with an empty figure. |
plot() | Plot array of points (x[],y[]) on the last series that is set with method series(seriesName, format). |
plotPoint() | Add (x,y) point to the last Series that is set with method series(seriesName,format). |
removeSeries() | Deletes a given series. |
series() | Series will be created with the name seriesName. |
setAutoScale() | Activates or deactivates auto scaling whenever the cart is updated. |
setAxisRange() | Set lower and upper limit of the X axis and the Y axis. |
setPlotTitle() | Sets the title of the active chart. |
setXLabel() | Set X axis name. |
setYLabel() | Set Y axis name. |
showGrid() | Activates or deactivates drawing of a background grid. |
title() | Alias for setPlotTitle(). |
xlabel() | Alias for setXLabel(). |
ylabel() | Alias for setYLabel(). |
org.eclipse.nebula.visualization.xygraph.figures.Annotation addMarker(String text, [Double xPosition], [Double yPosition])
Add a marker to the chart. A marker is a text label that points to a grid location. By default the marker will point to the data point that was added last. If positions are provided always xPosition and yPosition need to be provided. The returned marker can be further customized in the UI thread.
marker implementation
Chart createChart(Composite parent, [String figureId])
Create a new chart on a given parent composite.
new chart instance
void exportGraph([Object location], [boolean overwrite]) throws Throwable
Export the current figure as png file. When no location is provided, a popup dialog will ask the user for the target location.
true
file will be overwritten without questionOptional: defaults to <als>.Chart figure([String figureId]) throws Throwable
Opens a new view with an empty figure. figureId is used as a view and chart title. If a view with the same figureId already exists, it will be activated. The last activated figure will be used for all further commands of this modules.
new or activated chart
org.eclipse.nebula.visualization.xygraph.figures.Trace plot(double[] x, double[] y) throws Throwable
Plot array of points (x[],y[]) on the last series that is set with method series(seriesName, format). If there is no active Figure and Series then both will be created and activated.
series as Trace type to set different properties for this series
org.eclipse.nebula.visualization.xygraph.figures.Trace plotPoint(double x, double y) throws Throwable
Add (x,y) point to the last Series that is set with method series(seriesName,format). If there is no active figure and series then both will be created and activated.
series as Trace type to set different properties for this series
void removeSeries(String seriesName) throws Throwable
Deletes a given series. If the series does not exists this method does nothing.
org.eclipse.nebula.visualization.xygraph.figures.Trace series([String seriesName], [String format]) throws Throwable
Series will be created with the name seriesName. If the name is not given then Series will have the name "Series id" where id is the current number of the Series Iterator. Series Iterator start at 1 and with every new Series is incremented by one. If Series is already created with seriesName then that series will be set as currently active Series and on that Series methods will be performed. If there is no active Figure then Figure will be created and activated.
null
if no seriesName is given, in that case the name is "Series id" as explained aboveOptional: defaults to <null>.Specifier | LineStyle |
---|---|
'-' | Solid line (default) |
'--' | Dashed line |
':' | Dotted line |
'-.' | Dash-dot line |
'#' | No line |
Specifier | Color |
---|---|
r | Red |
g | Green |
b | Blue |
c | Cyan |
m | Magenta |
y | Yellow |
k | Black |
w | White |
Specifier | Marker Type |
---|---|
'+' | Plus sign |
'o' | Circle |
'p' | Point |
'x' | Cross |
's' | Square |
'f' | Filled Square |
'd' | Diamond |
'v' | Downward-pointing triangle |
series as Trace type to set different properties for this series
void setAutoScale(boolean performAutoScale)
Activates or deactivates auto scaling whenever the cart is updated. An auto scale may also be triggered by double clicking right into the chart area.
true
auto scaling will be enabledvoid setAxisRange(double[] xRange, double[] yRange)
Set lower and upper limit of the X axis and the Y axis.
Alias: axis()
org.eclipse.nebula.visualization.xygraph.figures.XYGraph setPlotTitle(String chartTitle)
Sets the title of the active chart.
Alias: title()
XYGraph object or null
if there is no active graph
org.eclipse.nebula.visualization.xygraph.figures.Axis setXLabel(String label)
Set X axis name.
Alias: xlabel()
Axis object or null
if there is no active graph
org.eclipse.nebula.visualization.xygraph.figures.Axis setYLabel(String label)
Set Y axis name.
Alias: ylabel()
Axis object or null
if there is no active graph
void showGrid(boolean showGrid)
Activates or deactivates drawing of a background grid.
true
a grid will be displayed