DataPlot::GetPlotType

Description

Get DataPlot type and also to get all the description strings.

Syntax

int GetPlotType( DataPlotStrings * pDescStrs = NULL, BASIC_PLOT_SETTINGS * pstPlotSettings = NULL )

Parameters

pDescStrs
[output] pointer to struct to receive strings on plot designations and range descriptions.
pstPlotSettings
[output] to receive basic plot settings like color.

Return

-1 if DataPlot is not a valid plot object, otherwise returns the plot type ID of one of the below value

IDM_PLOT_LINE
IDM_PLOT_SCATTER
IDM_PLOT_LINESYMB
IDM_PLOT_COLUMN
IDM_PLOT_AREA
IDM_PLOT_HILOCLOSE
IDM_PLOT_BOX

Examples

void DataPlot_GetPlotType_Ex1()
{
        //make sure there exists a graph with dataplots on it before running this code.
        GraphLayer gl = Project.ActiveLayer();
        if ( gl )
        {
                DataPlot dp = gl.DataPlots(0); //get the first dataplot on graphlayer            
                if( dp )
                {
                        DataPlotStrings stDescStrs;
                        int nPlotType = dp.GetPlotType(&stDescStrs); //returns integer value like IDM_PLOT_DOT, IDM_PLOT_LINE, IDM_PLOT_3D_LINE, etc.
                        if ( nPlotType > 0 )
                        {
                                printf("PlotType of DataPlot %s is %d\n", stDescStrs.szY, nPlotType);
                        }
                }
                else
                {
                        printf("DataPlot is not a valid object");
                }
        }
}

Remark

See Also

Header to Include

origin.h