GLG Toolkit, Java Class Library  Version 4.6

This group lists Chart methods of the Standard API. More...

Detailed Description

This group lists Chart methods of the Standard API.

The Chart methods of the Intermediate API contain additional methods that can be used to manipulate a Chart object.

Functions

GlgObject AddAnnotation (String resource_name, GlgObject annotation, double position_x, double position_y, boolean add_box)
 Adds an annotation to the chart object. More...
 
GlgObject AddPlot (String resource_name, GlgObject plot)
 Adds a plot line to the chart object. More...
 
GlgObject AddTimeLine (String resource_name, GlgObject time_line, double time_stamp)
 Adds a vertical time line to the chart object. More...
 
boolean ClearDataBuffer (String resource_name)
 Clears accumulated data samples of a real-time chart or one of its plots. More...
 
boolean DeleteAnnotation (String resource_name, GlgObject annotation, double position_x, double position_y)
 Deletes an annotation from the chart. More...
 
boolean DeletePlot (String resource_name, GlgObject plot)
 Deletes a plot line from the chart. More...
 
boolean DeleteTimeLine (String resource_name, GlgObject time_line, double time_stamp)
 Deletes a time line from the chart. More...
 
GlgMinMax GetChartDataExtent (String resource_name, boolean x_extent, boolean visible_only)
 Queries the minimum and maximum extent of the data accumulated in the chart or in one of its plots in the specified X or Y direction. More...
 
GlgObject GetNamedPlot (String resource_name, String plot_name)
 Given a name of the chart's plot, returns the plot's object ID. More...
 
boolean SetChartFilter (String resource_name, GlgChartFilter filter, Object client_data)
 Attaches a custom data filter to the chart's plot. More...
 
boolean SetLabelFormatter (String resource_name, GlgLabelFormatter formatter)
 Attaches a custom label formatter to the chart axis or the stand-alone axis object. More...
 
boolean SetLinkedAxis (String resource_name, GlgObject axis_object, String axis_resource_name)
 Associates the chart's plot, level line or annotation object with an Y axis for automatic rescaling. More...
 
boolean UpdateChartState (String resource_name, int state)
 Triggers updating the chart's state after prefilling it with data using the quick mode of AddDataSampleNode. More...
 
boolean UpdateChartTimeAxis (String resource_name, double time_stamp, boolean initialize)
 Scrolls the chart forward to show all data samples up to the provided time stamp or index. More...
 

Function Documentation

◆ AddAnnotation()

GlgObject AddAnnotation ( String  resource_name,
GlgObject  annotation,
double  position_x,
double  position_y,
boolean  add_box 
)

Adds an annotation to the chart object.

Parameters
resource_nameA resource path of a child chart, or null to add to the chart the method is invoked on. The resource path is relative to the invoking object.
annotationA Text object that will be used as an annotation. null may be used to create a new annotation.
position_xAn annotation's position relative to the X axis.
position_yAn annotation's position relative to the Y axis.
add_boxIf true, a text box will be added to the annotation's text object.
Returns
The added annotation on success, or null on failure.

The chart's NumAnnotations attribute should be set to -1 in order to use this method.

◆ AddPlot()

GlgObject AddPlot ( String  resource_name,
GlgObject  plot 
)

Adds a plot line to the chart object.

Parameters
resource_nameA resource path of a child chart, or null to add to the chart the method is invoked on. The resource path is relative to the invoking object.
plotA plot object. null may be used to create a new plot.
Returns
The added plot on success, or null on failure.

◆ AddTimeLine()

GlgObject AddTimeLine ( String  resource_name,
GlgObject  time_line,
double  time_stamp 
)

Adds a vertical time line to the chart object.

Parameters
resource_nameA resource path of a child chart, or null to add to the chart the method is invoked on. The resource path is relative to the invoking object.
time_lineA Level Line object to be used as a time line. null may be used to create a new time line.
time_stampThe timestamp to position the time line at. This value will be assigned to the time line's Level attribute.
Returns
The added time line on success, or null on failure.

The chart's NumTimeLines attribute should be set to -1 in order to use this method.

◆ ClearDataBuffer()

boolean ClearDataBuffer ( String  resource_name)

Clears accumulated data samples of a real-time chart or one of its plots.

Parameters
resource_nameA resource path of a child chart or a child plot, or null to clear the chart or the plot the method is invoked on. The resource path is relative to the invoking object.
Returns
  • true if any data samples were cleared
  • false on error or if no samples were cleared.

For a Chart object, ClearDataBuffer discards data samples in all plots of the chart. For a Plot object, it discards only the data samples of that plot.

◆ DeleteAnnotation()

boolean DeleteAnnotation ( String  resource_name,
GlgObject  annotation,
double  position_x,
double  position_y 
)

Deletes an annotation from the chart.

Parameters
resource_nameA resource path of a child chart, or null to delete from the chart the method is invoked on. The resource path is relative to the invoking object.
annotationThe annotation object to delete. If null, the annotation with the timestamp specified by the position_x and position_y parameters will be deleted.
position_xThe X position of the annotation to be deleted when the annotation parameter is null. The parameter is ignored if annotation is not null.
position_yThe Y position of the annotation to be deleted when the annotation parameter is null. The parameter is ignored if annotation is not null.
Returns
true if the annotation was successfully deleted.

The chart's NumAnnotations attribute should be set to -1 in order to use this method.

◆ DeletePlot()

boolean DeletePlot ( String  resource_name,
GlgObject  plot 
)

Deletes a plot line from the chart.

Parameters
resource_nameA resource path of a child chart, or null to delete from the chart the method is invoked on. The resource path is relative to the invoking object.
plotThe plot object to delete.
Returns
true if the plot was successfully deleted.

◆ DeleteTimeLine()

boolean DeleteTimeLine ( String  resource_name,
GlgObject  time_line,
double  time_stamp 
)

Deletes a time line from the chart.

Parameters
resource_nameA resource path of a child chart, or null to delete from the chart the method is invoked on. The resource path is relative to the invoking object.
time_lineThe time line object to delete. If null, the time line with the timestamp specified by time_stamp will be deleted.
time_stampThe timestamp of the time line to be deleted when the time_line parameter is null. The parameter is ignored if time_line is not null.
Returns
true if the plot was successfully deleted.

The chart's NumTimeLines attribute should be set to -1 in order to use this method.

◆ GetChartDataExtent()

GlgMinMax GetChartDataExtent ( String  resource_name,
boolean  x_extent,
boolean  visible_only 
)

Queries the minimum and maximum extent of the data accumulated in the chart or in one of its plots in the specified X or Y direction.

Parameters
resource_nameA resource path to access the child chart or the child plot. Use null to use the chart or the plot the method is invoked on. The resource path is relative to the invoking object.
x_extentIf true, the method returns the X extent, otherwise it returns the Y extent.
visible_onlyIf true, the method considers only visible data samples when calculating data extent, otherwise all samples are considered.
Returns
The returned data extent or null on error.

For a chart object, the method returns the data extent of all plots in the chart is returned. For a plot, the data extent of that plot is returned.

The object hierarchy must be set up for this method to succeed.

◆ GetNamedPlot()

GlgObject GetNamedPlot ( String  resource_name,
String  plot_name 
)

Given a name of the chart's plot, returns the plot's object ID.

Parameters
resource_nameA resource path of a child chart to query, or null to query the chart the method is invoked on. The resource path is relative to the invoking object.
plot_nameThe plot name.
Returns
The found plot, or null if a plot with the specified name was not found.

◆ SetChartFilter()

boolean SetChartFilter ( String  resource_name,
GlgChartFilter  filter,
Object  client_data 
)

Attaches a custom data filter to the chart's plot.

A data filter is invoked by a chart to aggregate the plot's data. See GlgChartFilter for more information.

Parameters
resource_nameA resource path of a child chart's plot, or null to attach the filter to the plot the method is invoked on. The resource path is relative to the invoking object.
filterA custom data filter.
client_dataData to be passed to the custom filter when it is invoked.
Returns
true if a custom filter was successfully attached.

◆ SetLabelFormatter()

boolean SetLabelFormatter ( String  resource_name,
GlgLabelFormatter  formatter 
)

Attaches a custom label formatter to the chart axis or the stand-alone axis object.

See GlgLabelFormatter for more information.

Parameters
resource_nameA resource path of a child axis, or null to attach the formatter to the axis the method is invoked on. The resource path is relative to the invoking object.
formatterA custom label formatter.
Returns
true if the formatter was successfully attached.

◆ SetLinkedAxis()

boolean SetLinkedAxis ( String  resource_name,
GlgObject  axis_object,
String  axis_resource_name 
)

Associates the chart's plot, level line or annotation object with an Y axis for automatic rescaling.

Parameters
resource_nameA resource path for accessing the child plot, the level line or the annotation inside the object the method is invoked on. The resource path is relative to the invoking object. Use null to use the plot, level line or annotation object the method is invoked on.
axis_objectThe axis to link with, or the axis' parent.
axis_resource_nameA resource path for accessing the axis inside axis_object, or inside the object the method is invoked on if axis_object is null. Use null when the axis_object parameter specifies an axis.
Returns
Success or failure status.

◆ UpdateChartState()

boolean UpdateChartState ( String  resource_name,
int  state 
)

Triggers updating the chart's state after prefilling it with data using the quick mode of AddDataSampleNode.

Parameters
resource_nameA resource path of a child chart, or null to update the chart the method is invoked on. The resource path is relative to the invoking object.
state

Contains binary flags that specify the state to be updated:

Multiple flags can be combined with bitwise OR operator.

Returns
Success or failure status.

This method marks the selected chart states for updating. The actual update happens on the next invocation of the Update or SetupHierarchy methods.

◆ UpdateChartTimeAxis()

boolean UpdateChartTimeAxis ( String  resource_name,
double  time_stamp,
boolean  initialize 
)

Scrolls the chart forward to show all data samples up to the provided time stamp or index.

Parameters
resource_nameA resource path of a child chart, or null to scroll the chart the method is invoked on. The resource path is relative to the invoking object.
time_stampA timestamp (or an index for a chart with an index X axis).
initializeMay be set to true for initializing an empty sweep chart, positioning the sweep bar at the start of the plot instead of the plot end.
Returns
Success or failure status.

While a strip chart's X axis can be updated by simply setting its EndValue resource to the timestamp, a sweep chart needs to update the sweep bar and update the X axis only if needed.

UpdateChartTimeAxis should be used to properly update sweep charts after using the quick mode of the AddDataSampleNode method to supply a large number of data samples. The method handles both strip and sweep charts.