GetLegend
Get plot legend as it is displayed.
BOOL GetLegend( string & str, LPCSTR lpcszCustomFormat = NULL, BOOL bClean = true )
TRUE for success or FALSE if lpcszCustomFormat is specified but is not in the valid format.
void DataPlot_GetLegend_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 ) { string strLegend; if ( dp.GetLegend(strLegend) ) { printf("DataPlot %s's Legend is : %s\n", dp.GetName(), strLegend); } } } }
origin.h