2.1.14.1.6 get_selected_data_plot


Description

Get the index of the selected data plot in the active graph layer.

Syntax

int get_selected_data_plot()

Parameters

None.

Return

Return the index of the selected data plot if successful.

Returns -1 means no selected data plot, then return the index of the active one.

Returns -2 means the active window is not graph.

Examples

EX1

// Before running, plot a data on graph, and click on the data plot to select
void get_selected_data_plot_ex1()
{
	int nPlotIndex = get_selected_data_plot();
	if( nPlotIndex >= 0 ) 
	{
		GraphLayer gl = Project.ActiveLayer();
		DataPlot dp = gl.DataPlots(nPlotIndex);
		
		string str;
		if( dp.GetRangeString(str) )
			out_str(str);
	}
}

Remark

GraphLayer::DataPlots(-1) returns the index of the active data plot, but this function returns the selected data plot, the result of two functions is different.

See Also

GraphLayer::DataPlots

Header to Include

origin.h

Reference