|
GLG Toolkit, C / C++ API Library
Version 4.6
|
This group lists Chart functions of the Standard API. More...
This group lists Chart functions of the Standard API.
The Chart functions of the Intermediate API contain additional functions that can be used to manipulate a Chart object.
Functions | |
| GlgObject | GlgAddAnnotation (GlgObject object, char *resource_name, GlgObject annotation, double position_x, double position_y, GlgBoolean add_box) |
| Adds an annotation to a chart object. More... | |
| GlgObject | GlgAddPlot (GlgObject object, char *resource_name, GlgObject plot) |
| Adds a plot line to a chart object. More... | |
| GlgObject | GlgAddTimeLine (GlgObject object, char *resource_name, GlgObject time_line, double time_stamp) |
| Adds a vertical time line to a chart object. More... | |
| GlgBoolean | GlgClearDataBuffer (GlgObject object, char *resource_name) |
| Clears accumulated data samples of a real-time chart or one of its plots. More... | |
| GlgBoolean | GlgDeleteAnnotation (GlgObject object, char *resource_name, GlgObject annotation, double position_x, double position_y) |
| Deletes an annottion from a chart. More... | |
| GlgBoolean | GlgDeletePlot (GlgObject object, char *resource_name, GlgObject plot) |
| Deletes a plot line from a chart. More... | |
| GlgBoolean | GlgDeleteTimeLine (GlgObject object, char *resource_name, GlgObject time_line, double time_stamp) |
| Deletes a time line from a chart. More... | |
| GlgBoolean | GlgGetChartDataExtent (GlgObject object, char *resource_name, GlgMinMax *min_max, GlgBoolean x_extent, GlgBoolean visible_only) |
| Queries the minimum and maximum extent of the data accumulated in a chart or in one of its plots in the specified X or Y direction. More... | |
| GlgObject | GlgGetNamedPlot (GlgObject object, char *resource_name, char *plot_name) |
| Given a name of a chart's plot, returns the plot's object ID. More... | |
| GlgObject | GlgGetSelectedPlot (void) |
| Returns the plot object corresponding to the last legend item selected with the mouse, if any. More... | |
| GlgBoolean | GlgSetChartFilter (GlgObject object, char *resource_name, GlgChartFilter chart_filter, void *client_data) |
| Attaches a custom data filter to a chart's plot. More... | |
| GlgBoolean | GlgSetLabelFormatter (GlgObject object, char *resource_name, GlgLabelFormatter formatter) |
| Attaches a custom label formatter to a chart axis or a stand-alone axis object. More... | |
| GlgBoolean | GlgSetLinkedAxis (GlgObject object, char *resource_name, GlgObject axis_object, char *axis_resource_name) |
| Associates a chart's plot, level line or annotation object with an Y axis for automatic rescaling. More... | |
| GlgBoolean | GlgUpdateChartState (GlgObject object, char *resource_name, GlgChartState state) |
| Triggers updating a chart's state after prefilling it with data using the quick mode of GlgAddDataSampleNode. More... | |
| GlgBoolean | GlgUpdateChartTimeAxis (GlgObject object, char *resource_name, double time_stamp, GlgBoolean initialize) |
| Scrolls the chart forward to show all data samples up to the provided time stamp or index. More... | |
| GlgObject GlgAddAnnotation | ( | GlgObject | object, |
| char * | resource_name, | ||
| GlgObject | annotation, | ||
| double | position_x, | ||
| double | position_y, | ||
| GlgBoolean | add_box | ||
| ) |
Adds an annotation to a chart object.
| object | A chart or a parent object containing the chart. |
| resource_name | A resource path for accessing the chart inside the parent. Use NULL when the object parameter specifies the chart. |
| annotation | An object ID of Text object that will be used as an annotation. NULL may be used to create a new annotation. |
| position_x | An annotation's position relative to the X axis. |
| position_y | An annotation's position relative to the Y axis. |
| add_box | If True, a text box will be added to the annotation's text object. |
If the annotation parameter is NULL, the returned annotation is referenced only by the chart's annotation array it has been added to and may be destroyed when the chart scrolls. The program should increase the annotation's reference count if it needs to keep a persistent reference to it.
The chart's NumAnnotations attribute should be set to -1 in order to use this function
Adds a plot line to a chart object.
| object | A chart or a parent object containing the chart. |
| resource_name | A resource path for accessing the chart inside the parent. Use NULL when the object parameter specifies the chart. |
| plot | An object ID of a plot object. NULL may be used to create a new plot. |
If the plot parameter is NULL, the returned plot is referenced only by the chart's plot array it has been added to and may be destroyed when the number of plots changes. The program should increase the plot's reference count if it needs to keep a persistent reference to the plot.
| GlgObject GlgAddTimeLine | ( | GlgObject | object, |
| char * | resource_name, | ||
| GlgObject | time_line, | ||
| double | time_stamp | ||
| ) |
Adds a vertical time line to a chart object.
| object | A chart or a parent object containing the chart. |
| resource_name | A resource path for accessing the chart inside the parent. Use NULL when the object parameter specifies the chart. |
| time_line | An object ID of a Level Line object to be used as a time line. NULL may be used to create a new time line. |
| time_stamp | The time stamp to position the time line at. This value will be assigned to the time line's Level attribute. |
If the time_line parameter is NULL, the returned time line is referenced only by the chart's time line array it has been added to and may be destroyed when the chart scrolls. The program should increase the time line's reference count if it needs to keep a persistent reference to the time line.
The chart's NumTimeLines attribute should be set to -1 in order to use this function.
| GlgBoolean GlgClearDataBuffer | ( | GlgObject | object, |
| char * | resource_name | ||
| ) |
Clears accumulated data samples of a real-time chart or one of its plots.
| object | Specifies a chart, a plot or a parent object containing them. |
| resource_name | If not NULL, specifies a resource path for accessing the chart or one of its plots inside the container specified by the object parameter. Use NULL when the object parameter specifies a chart or plot object. |
For a Chart object, GlgClearDataBuffer discards data samples in all plots of the chart. For a Plot object, it discards only the data samples of that plot.
| GlgBoolean GlgDeleteAnnotation | ( | GlgObject | object, |
| char * | resource_name, | ||
| GlgObject | annotation, | ||
| double | position_x, | ||
| double | position_y | ||
| ) |
Deletes an annottion from a chart.
| object | A chart or a parent object containing the chart. |
| resource_name | A resource path for accessing the chart inside the parent. Use NULL when the object parameter specifies the chart. |
| annotation | The annotation object to delete. If NULL, the annotation with the time stamp specified by the position_x and position_y parameters will be deleted. |
| position_x | The X position of the annotation to be deleted when the annotation parameter is NULL. The parameter is ignored if annotation is not NULL. |
| position_y | The Y position of the annotation to be deleted when the annotation parameter is NULL. The parameter is ignored if annotation is not NULL. |
The chart's NumAnnotations attribute should be set to -1 in order to use this function.
| GlgBoolean GlgDeletePlot | ( | GlgObject | object, |
| char * | resource_name, | ||
| GlgObject | plot | ||
| ) |
Deletes a plot line from a chart.
| object | A chart or a parent object containing the chart. |
| resource_name | A resource path for accessing the chart inside the parent. Use NULL when the object parameter specifies the chart. |
| plot | The plot object to delete. |
| GlgBoolean GlgDeleteTimeLine | ( | GlgObject | object, |
| char * | resource_name, | ||
| GlgObject | time_line, | ||
| double | time_stamp | ||
| ) |
Deletes a time line from a chart.
| object | A chart or a parent object containing the chart. |
| resource_name | A resource path for accessing the chart inside the parent. Use NULL when the object parameter specifies the chart. |
| time_line | The object ID of the time line to delete. If NULL, the time line with the time stamp specified by time_stamp will be deleted. |
| time_stamp | The time stamp of the time line to be deleted when the time_line parameter is NULL. The parameter is ignored if time_line is not NULL. |
The chart's NumTimeLines attribute should be set to -1 in order to use this function.
| GlgBoolean GlgGetChartDataExtent | ( | GlgObject | object, |
| char * | resource_name, | ||
| GlgMinMax * | min_max, | ||
| GlgBoolean | x_extent, | ||
| GlgBoolean | visible_only | ||
| ) |
Queries the minimum and maximum extent of the data accumulated in a chart or in one of its plots in the specified X or Y direction.
| object | A chart, a plot or a parent object containing the chart. |
| resource_name | A resource path to access the chart or the plot inside the object. Use NULL when the object parameter specifies a chart or a plot. The resource path is relative to the object specified by the object parameter. |
| min_max | The receiver of the returned data extent. |
| x_extent | If True, the function returns the X extent, otherwise it returns the Y extent. |
| visible_only | If True, the function considers only visible data samples when calculating data extent, otherwise all samples are considered. |
If the object and resource_name parameters point to a chart object, the data extent of all plots in the chart is returned. If object and resource_name point to a plot, the data extent of that plot is returned.
The object hierarchy must be set up for this function to succeed.
Given a name of a chart's plot, returns the plot's object ID.
| object | A chart or a parent object containing a chart. |
| resource_name | A resource path for accessing the chart inside the parent. Use NULL when the object parameter specifies the chart. |
| plot_name | The plot name. |
| GlgObject GlgGetSelectedPlot | ( | void | ) |
Returns the plot object corresponding to the last legend item selected with the mouse, if any.
The setting of the chart's viewport ProcessMouse attribute controls when legend selection happens:
This function can be used in conjunction with a mouse click Action attached to the Legend object. The DEMOS/RealTime_StripChart/stripchart.c file in the GLG installation directory provides an example of using this technique to highlight a plot when its legend icon is clicked on.
See also GlgGetLegendSelection.
| GlgBoolean GlgSetChartFilter | ( | GlgObject | object, |
| char * | resource_name, | ||
| GlgChartFilter | chart_filter, | ||
| void * | client_data | ||
| ) |
Attaches a custom data filter to a chart's plot.
A data filter is a function which is invoked by a chart to aggregate the plot's data. See GlgChartFilter for more information.
| object | A chart's plot, a chart or a parent object containing the chart. |
| resource_name | A resource path for accessing the plot inside the parent. Use NULL when the object parameter specifies the plot. |
| chart_filter | A custom data filter. |
| client_data | Data to be passed to the custom filter when it is invoked. |
| GlgBoolean GlgSetLabelFormatter | ( | GlgObject | object, |
| char * | resource_name, | ||
| GlgLabelFormatter | formatter | ||
| ) |
Attaches a custom label formatter to a chart axis or a stand-alone axis object.
See GlgLabelFormatter for more information.
| object | A chart or a parent object containing the chart. |
| resource_name | A resource path for accessing the chart inside the parent. Use NULL when the object parameter specifies the chart. |
| formatter | A custom label formatter. |
| GlgBoolean GlgSetLinkedAxis | ( | GlgObject | object, |
| char * | resource_name, | ||
| GlgObject | axis_object, | ||
| char * | axis_resource_name | ||
| ) |
Associates a chart's plot, level line or annotation object with an Y axis for automatic rescaling.
| object | A plot, a level line or an annotation to be linked with the axis, or a parent object containing them. |
| resource_name | A resource path for accessing the plot, the level line of the annotation inside the parent. Use NULL when the object parameter specifies a plot, a level line or an annotation object. The resource path is relative to the object specified by the object parameter. |
| axis_object | The axis to link with, or the axis' parent. |
| axis_resource_name | A resource path for accessing the axis inside axis_object, or inside the object if axis_object is NULL. Use NULL when the axis_object parameter specifies an axis. |
| GlgBoolean GlgUpdateChartState | ( | GlgObject | object, |
| char * | resource_name, | ||
| GlgChartState | state | ||
| ) |
Triggers updating a chart's state after prefilling it with data using the quick mode of GlgAddDataSampleNode.
| object | A chart or a parent object containing the chart. |
| resource_name | A resource path for accessing the chart inside the parent. Use NULL when the object parameter specifies the chart. |
| state | Contains binary flags that specify the state to be updated:
|
This function marks the selected chart states for updating. The actual update happens on the next invocation of the GlgUpdate or GlgSetupHierarchy functions.
| GlgBoolean GlgUpdateChartTimeAxis | ( | GlgObject | object, |
| char * | resource_name, | ||
| double | time_stamp, | ||
| GlgBoolean | initialize | ||
| ) |
Scrolls the chart forward to show all data samples up to the provided time stamp or index.
| object | A chart or a parent object containing the chart. |
| resource_name | A resource path for accessing the chart inside the parent. Use NULL when the object parameter specifies the chart. |
| time_stamp | A time stamp (or an index for a chart with an index X axis). |
| initialize | May 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. |
While a strip chart's X axis can be updated by simply setting its EndValue resource to the time stamp, a sweep chart needs to update the sweep bar and update the X axis only if needed.
GlgUpdateChartTimeAxis should be used to properly update sweep charts after using the quick mode of the GlgAddDataSampleNode function to supply a large number of data samples. The function handles both strip and sweep charts.