2.2.4.8.18 DataPlot::GetModifiers

Description

Get modifiers.

Syntax

int GetModifiers( vector<int> & vnDesigs, vector<string> & saNames, DWORD dwCntrl = 0 )

Parameters

vnDesigs
[output]the property for which the modifier is specified:
COLDESIG_SIZE, symbol size
COLDESIG_COLOR, symbol color from a colormap
COLDESIG_VECTOR_ANGLE, vector plot angle column
COLDESIG_VECTOR_MAGNITUDE, vector plot magnitude column
COLDESIG_VECTOR_XEND, flow vector x-coordinate of the arrow end
COLDESIG_VECTOR_XEND, flow vector y-coordinate of the arrow end
COLDESIG_PLOTLABEL_FORM, label
see PlotDesignationEx in OC_const.h for more options.
saNames
[output]range names of the columns to be used as the modifier from which the dataplot will draw values for the modified property.
dwCntrl
[input]
enum
{
	GET_MODI_ONLY_COLORMAP	= 0x00000001, //only get colormap columns
};

Return

0 if successfully get the modifiers

Examples

EX1

// assum a worksheet has 3 columns
// make a scatter plot with first 2 columns 
// and use the 3rd column as plot label
void DataPlot_GetModifiers_ex()
{
	Worksheet wks = Project.ActiveLayer();
	if(!wks)
		return;
	Column col(wks, 2);
	if(!col)
		return;
	
	DataRange dr;	
	dr.Add(wks, 0, "X");
	dr.Add(wks, 1, "Y");
	
	GraphPage gp;
	gp.Create("Origin");
	GraphLayer gl = gp.Layers();	
	gl.AddPlot(dr, IDM_PLOT_SCATTER);
	gl.Rescale();
	
	DataPlot dp = gl.DataPlots(0); 
	if(!dp)
		return;
	dp.SetModifier(COLDESIG_PLOTLABEL_FORM, col);
	
	vector<int> vnDesigs;
	vector<string> saNames;
	dp.GetModifiers(vnDesigs, saNames);
	
	vector<uint> vecIndex;
	if(vnDesigs.Find(vecIndex, COLDESIG_PLOTLABEL_FORM) > 0) 
	{
		printf("label form = %s\n", saNames[ vecIndex[0] ]);
	}
}

Remark

See Also

DataPlot::SetModifier
GroupPlot::GetModifiers
okutil_get_col_by_ocolor

Header to Include

origin.h