DataPlot::SetFunctionContext

 

Description

Set function plot context.

Syntax

BOOL SetFunctionContext( const FunctionPlotContext & context )

Parameters

context
[input] function plot context

Return

TRUE if success

Examples

EX1

//assume there is a funtion plot
void     DataPlot_SetFunctionContext_Ex1()
{
    GraphLayer gl = Project.ActiveLayer();
    if( gl )
    {
        DataPlot dp = gl.DataPlots();
        FunctionPlotContext context;
        dp.GetFunctionContext(context);
        
        printf("Before SetFunctionContext strFormula1: %s\n", context.strFormula1);
        
        string strFormula = "3*x";
        lstrcpyn(context.strFormula1, strFormula, MAX_FORMULA_SIZE);
        BOOL bSuccess = dp.SetFunctionContext(context);
         
        //get again to see the context value 
        dp.GetFunctionContext(context);
        
        printf("SetFunctionContext return: %d\nstrFormula1: %s\n", bSuccess, context.strFormula1);
    }
}

Remark

See Also

DataPlot::GetFunctionContext

header to Included

origin.h