![]() |
CNiGraph | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Class |
Declared in: NiGraph.h |
Overview
CNiGraph encapsulates the interface to the Measurement Studio ActiveX graph control, which allows you to plot and chart two-dimensional data.
CNiGraph is capable of responding to events that are generated by the control. For a list of the events that can be generated by this control and details on how to respond to the events in your program, refer to the Graph Events page.
Features
- Plotting and Charting - plotting data refers to the process of taking a large number of points and updating one or more plots on the graph with new data, replacing the old plot with the new plot. Charting data appends new data points to an existing plot over time. Charting is used with slow processes where only few data points per second are added to the graph. When the number of data points exceeds the number of points that can be displayed on the graph, the graph scrolls so that new points are added to the right side of the graph while old points disappear to the left.
- Multiple plot styles - point, line, line-point, and bar.
- Multiple plots with individual properties such as name, line and point style, width, and base value.
- Cursors - display a crosshair on a graph to mark a specific point or region on the graph or highlight data.
- Configurable axes, including customizable ticks, labels, value pairs, and captions.
- Built-in format styles for labels, including scientific, symbolic engineering, scaling, time, and date.
- Panning and zooming at runtime - panning is useful when the graph displays only a subset of the data that has been plotted. You can scroll through all data plotted on the graph, essentially shifting the graph's display to different portions of the plot.
Note: Set the TrackMode property to allow user interaction (such as panning, zooming, moving cursors, and moving annotations) with the graph while your program is running.
- CNiGraph includes bindable properties. You can bind these properties to a DataSocket source or target. This allows you to read property values from and write property values to the source or target. Click here for a list of bindable properties.
Note: To specify a date/time value, you must convert your date or time value to a double. A date is implemented as a floating-point value with the integer part of the number measuring days from midnight, 30 December 1899, and the fractional part representing the time of day. The absolute value of the fractional part of the number represents the time as a fraction of a day. Thus, 1 second equals 1 / 24 hours / 60 minutes, which is 1/86400 or approximately 1.157407e-5. So, midnight, 31 December 1899, is represented by 1.0. Similarly, 6 AM, 1 January 1900, is represented by 2.25, and midnight, 29 December 1899, is -1.0. However, 6 AM, 29 December 1899, is -1.25.
Base Classes
Data Items
![]() |
CNiAnnotations | Annotations | Gets a collection of annotation objects associated with the control. |
![]() |
CNiAnnotation | AnnotationTemplate | Returns the annotation to use as a template for new annotations. |
![]() |
CNiAxes | Axes | Gets a collection of axis objects associated with the control. |
![]() |
CNiColor | BackColor | Specifies the color for the graph caption's background. |
![]() |
CNiBindings | Bindings | Gets a collection of binding objects associated with the control. |
![]() |
CString | Caption | Specifies the caption to be drawn on the CNiGraph. |
![]() |
CNiColor | CaptionColor | Specifies the color of the caption. |
![]() |
long | ChartLength | Specifies how many points the graph stores when charting before deleting old data. |
![]() |
ChartStyles | ChartStyle | Specifies how chart functions update the display as new data is added to the plot. |
![]() |
CNiCursors | Cursors | Gets a collection of cursor objects associated with the control. |
![]() |
bool | DefaultPlotPerRow | This is the default value used by the overloaded versions of the Plot/Chart functions that do not take the plotPerRow parameter. |
![]() |
double | DefaultXFirst | This is the default value used by the overloaded versions of the PlotY functions that do not take the xFirst parameter. |
![]() |
double | DefaultXInc | This is the default value used by the overloaded versions of the PlotY and ChartY functions that do not take the xInc parameter. |
![]() |
bool | Enabled | Specifies if the graph generates any events. |
![]() |
CNiFont | Font | Specifies the font for labels on all axes. |
![]() |
CNiColor | GraphFrameColor | Specifies the color for the graph frame. |
![]() |
GraphFrameStyles | GraphFrameStyle | Determines if the graph has a 3D frame or a classic frame. |
![]() |
bool | ImmediateUpdates | Specifies if the graph draws new data as soon as it is available. |
![]() |
KeyboardModes | KeyboardMode | Specifies how the control handles keyboard input from the user. |
![]() |
CNiColor | PlotAreaColor | Specifies the background color of the plot area. |
![]() |
CNiPlots | Plots | Gets a collection of plot objects associated with the control. |
![]() |
CNiPlot | PlotTemplate | Returns the plot to use as a template for new plots. |
![]() |
long | ReadyState | Returns the ready state of the control. |
![]() |
GraphTrackModes | TrackMode | Determines how the mouse interacts with the graph. |
![]() |
bool | Windowless | Specifies if the control has a window. |
Constructors
![]() |
CNiGraph( CNiInterface::ThreadAccess option = CNiInterface::MultipleThreadsWithCaching ) |
Destructors
Functions
![]() |
void | AboutBox() |
Displays the About Box for the control. |
![]() |
void | ChartXvsY( const CNiVector& x, const CNiMatrix& y, bool chartPerRow ) |
Charts a matrix of data as one or more x-y plots. |
![]() |
void | Charts a matrix of data as one or more x-y plots. | |
![]() |
void | Charts two vectors of data as a single x-y plot. | |
![]() |
void | Charts a matrix of data as one or more x-y plots. | |
![]() |
void | Charts a matrix of data as one or more x-y plots. | |
![]() |
void | ChartXY( double x, double y ) |
Charts a single point of data as one x-y plot. |
![]() |
void | Charts a matrix of data as one or more y plots. | |
![]() |
void | Charts a matrix of data as one or more y plots. | |
![]() |
void | Charts a matrix of data as one or more y plots. | |
![]() |
void | Charts a vector of data. | |
![]() |
void | Charts a vector of data. | |
![]() |
void | ChartY( double y, double xInc ) |
Charts a point of data. |
![]() |
void | ChartY( double y ) |
Charts a point of data. |
![]() |
void | Clears data in all plots. | |
![]() |
CNiPicture | Returns an image of the entire control. | |
![]() |
virtual BOOL | Create( LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL ) |
Creates the ActiveX control that is represented in the MFC program by this object. |
![]() |
BOOL | Create( LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE, BSTR bstrLicKey = NULL ) |
Creates the ActiveX control that is represented in the MFC program by this object. |
![]() |
BOOL | CreateControl( LPCTSTR lpszClass, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE, BSTR bstrLicKey = NULL ) |
Creates the ActiveX control that is represented in the MFC program by this object. |
![]() |
BOOL | CreateControl( REFCLSID clsid, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE, BSTR bstrLicKey = NULL ) |
Creates the ActiveX control that is represented in the MFC program by this object. |
![]() |
void | ExportStyle( LPCTSTR fileName ) |
Exports the style of the control to a file. |
![]() |
static const CLSID & | GetClsid() |
Returns the globally unique identifier (GUID) of the ActiveX control to which this class connects. |
![]() |
static const IID & | GetIid() |
Returns the globally unique identifier (GUID) of the ActiveX interface to which this class connects. |
![]() |
CNiImage | Gets the image object associated with the specified part of the CNiGraph control. | |
![]() |
CNiImage | Images( long imageIndex ) |
Gets the image object associated with the specified part of the CNiGraph control. |
![]() |
void | ImportStyle( LPCTSTR fileName ) |
Imports a previously exported style. |
![]() |
void | PlotXvsY( const CNiVector& x, const CNiMatrix& y, bool plotPerRow ) |
Plots a matrix of data as one or more x-y plots. |
![]() |
void | Plots a matrix of data as one or more x-y plots. | |
![]() |
void | Plots two vectors of data as a single x-y plot. | |
![]() |
void | Plots a matrix of data as one or more x-y plots. | |
![]() |
void | Plots a matrix of data as one or more x-y plots. | |
![]() |
void | PlotXY( double x, double y ) |
Plots a single point of data as one x-y plot. |
![]() |
void | PlotY( const CNiMatrix& y, double xFirst, double xInc, bool plotPerRow ) |
Plots a matrix of data as one or more y plots. |
![]() |
void | Plots a matrix of data as one or more y plots. | |
![]() |
void | Plots a matrix of data as one or more y plots. | |
![]() |
void | Plots a vector of data as a single y plot. | |
![]() |
void | Plots a vector of data as a single y plot. | |
![]() |
void | Plots a vector of data as a single y plot. | |
![]() |
void | Refresh() |
Forces the control to redraw. |
![]() |
void | Validates the current state of the control. |