2.1.14.1.12 legend_append_plot


Description

Append the string of one dataplot to legend

Syntax

bool legend_append_plot( GraphLayer & gl, int nPlot, LPCSTR lpcszExtraFormat = NULL, LPCSTR lpcszSep = NULL )

Parameters

gl
[input] the graphlayer to which the dataplot belong
nPlot
[input] the dataplot's index
lpcszExtraFormat
[input] optional, if not NULL, extra information of how to display the legend. For example:
@LM: comment(1stline), or longname or short name, depending on presence in that order
@R: Full Range string in the form or [BookName]SheetName!Col_Name[Row_range]
lpcszSep
[input] separator between dataplot's names in legend text. If NULL, will use "\r\n" as default

Return

return true on success, else return false

Examples

EX1

void    legend_append_plot_ex1()
{
    //make sure a active graph with two plots, and the legend only has the first plot
    GraphLayer gl = Project.ActiveLayer();
    if ( gl )
    {
        int nPlot = 1;
        if ( legend_append_plot(gl, nPlot, "@R") )
            printf("Success!");
        else
            printf("Fail!");
    }
}

Remark

The seperator string may not be "\r\n" as Iris said, default is "\r\n"

See Also

Header to Included

origin.h

Reference