CNiPlot

CNi

Class CNiPlot Base ClassesData ItemsConstructorsDestructorsFunctionsGo to hierarchy chart    Prev page: PlotYNext page: AutoScale    
Class Declared in:
NiPlot.h

'Overview' icon -- Shortcut to top of page. Overview

CNiPlot encapsulates the interface to a single plot of a graph control, which allows you to modify its appearance and behavior.

You get individual plots using the Plots property on a CNiGraph object.

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.

Hierarchy Chart Hierarchy Chart

'Base Classes' icon -- Shortcut to top of page. Base Classes

'Data Items' icon -- Shortcut to top of page. Data Items

Public data bool AutoScale Specifies if the extents of the data in the plot affect the extents of an autoscaling axis.
Public data CNiPlot BasePlot Specifies a plot to use for Y values when FillToBase or LineToBase is enabled.
Public data double BaseValue Specifies the Y value to use when FillToBase or LineToBase is enabled.
Public data double DefaultXFirst Specifies the default value used by the overloaded versions of the PlotY function that do not take the xFirst parameter.
Public data double DefaultXInc Specifies the default value used by the overloaded versions of the PlotY and ChartY functions that do not take the xInc parameter.
Public data bool DefaultXInFirstRow Specifies the default value used by the overloaded versions of the PlotXY and ChartXY functions that do not take the xInFirstRow parameter.
Public data bool Enabled Specifies if the plot generates mouse events when CNiGraph::TrackMode = CNiGraph::TrackAllEvents and the plot is visible.
Public data CNiColor FillColor Specifies the color to use for filling to the BaseValue or BasePlot.
Public data bool FillToBase Specifies if the function fills the area between the plot and the CNiPlot::BaseValue or CNiPlot::BasePlot.
Public data CNiColor LineColor Specifies the color of line that connects points in the plot.
Public data LineStyles LineStyle Specifies the line style for connecting points on a plot.
Public data bool LineToBase Specifies if lines connect the data points to the CNiPlot::BaseValue or CNiPlot::BasePlot.
Public data CNiColor LineToBaseColor Specifies the color of lines connecting data points to the CNiPlot::BaseValue or CNiPlot::BasePlot.
Public data short LineWidth Specifies the width of the plotting line.
Public data bool MultiPlot Determines if the plot or chart functions can use this plot.
Public data CString Name Specifies the name of the plot.
Public data CNiColor PointColor Specifies the color for points on a plot.
Public data PointStyles PointStyle Specifies the point style for drawing points on a plot.
Public data bool TempPlot Specifies if you can discard a plot if the next CNiGraph plot or chart function does not need it.
Public data bool Visible Specifies if the plot is visible or hidden.
Public data CNiAxis XAxis Gets the x axis for a plot.
Public data CNiAxis YAxis Specifies the y axis for a plot.

'Constructors' icon -- Shortcut to top of page. Constructors

Public constructor

CNiPlot()

Default constructor.
Public constructor

CNiPlot( CWPlot_CI* pCustom, CNiInterface::ThreadAccess option )

Constructor that attaches to the specified CWPlot_CI pointer.
Public constructor

CNiPlot( const CNiPlot& source )

Copy constructor.

'Destructors' icon -- Shortcut to top of page. Destructors

Public destructor

~CNiPlot()

Destructor.

'Functions' icon -- Shortcut to top of page. Functions

Public function void

ChartXvsY( const CNiVector& x, const CNiVector& y )

Charts a vector of Y data against a vector of X data.
Public function void

ChartXY( const CNiMatrix& xy, bool xInFirstRow )

Charts a matrix of data as an X-Y plot.
Public function void

ChartXY( const CNiMatrix& xy )

Charts a matrix of data as an X-Y plot.
Public function void

ChartXY( double x, double y )

Charts a matrix of data as an X-Y plot.
Public function void

ChartY( const CNiVector& y, double xInc )

Charts a vector of data.
Public function void

ChartY( const CNiVector& y )

Charts a vector of data.
Public function void

ChartY( double y, double xInc )

Charts a point of data.
Public function void

ChartY( double y )

Charts a point of data.
Public function void

ClearData()

Clears the data currently displayed in the plot.
Public function static const IID &

GetIid()

Returns the globally unique identifier (GUID) of the ActiveX interface to which this class connects.
Public function const CNiPlot &

operator =( const CNiPlot& source )

Assignment operator.
Public function void

PlotXvsY( const CNiVector& x, const CNiVector& y )

Plots a vector of Y data against a vector of X data.
Public function void

PlotXY( const CNiMatrix& xy, bool xInFirstRow )

Plots a matrix of data as an X-Y plot.
Public function void

PlotXY( const CNiMatrix& xy )

Plots a matrix of data as an X-Y plot.
Public function void

PlotXY( double x, double y )

Plots a single point of data as an X-Y plot.
Public function void

PlotY( const CNiVector& y, double xFirst, double xInc )

Plots a vector of data.
Public function void

PlotY( const CNiVector& y, double xFirst )

Plots a vector of data.
Public function void

PlotY( const CNiVector& y )

Plots a vector of data.

Shortcut to top of page. Example

// Add a sine wave plot to the graph.
CNiGraph graph;
CNiReal64Vector wfm(1000);
CNiMath::SineWave(wfm);
graph.PlotY(wfm);
// Get the plot from the graph and change its line style.
CNiPlot plot = graph.Plots.Item(1);
plot.LineStyle = CNiPlot::LineDash;