Regular API function

simAddGraphCurve / sim.addGraphCurve

Description Adds or updates a graph curve. See also the other functions related to graphs.
C synopsis simInt simAddGraphCurve(simInt graphHandle,const simChar* curveName,simInt dim,const simInt* streamIds,const simFloat* defaultValues,const simChar* unitStr,simInt simInt options,const simFloat* color,simInt curveWidth)
C parameters
graphHandle: handle of the graph
curveName: name of the curve
dim: dimension of the curve. Valid values are 2 or 3
streamIds: a pointer to 2 or 3 graph streams (x/y curves require 2 stream IDs, xyz curves require 3 stream IDs). Indicate -1 for a missing stream, in which case a default value will be used instead
defaultValues: a pointer to 2 or 3 default values
unitStr: string describing the unit of the curve. Can be nullptr
options: bit-coded: bit0 is not used. If bit1 is set (2), the label is not visible. If bit2 is set (4), the points are not linked.
color: rgb-triplet, with values in [0.0-1.0], indicating the color of the stream. Can be nullptr
curveWidth: the width of an xyz curve
C return value
-1 if operation was not successful, otherwise the id of the created/updated curve
Lua synopsis int curveId=sim.addGraphCurve(int graphHandle,string curveName,int dim,table[] streamIds,table[] defaultValues,string unitStr,int options=0,table[3] color={0,1,0},int curveWidth=2)
Lua parameters
Similar to the C-function counterpart
Lua return values
Similar to the C-function counterpart