Hi Dodo,
Sorry that I did not see that your plot data was from worksheet. However the example is used for the plot whose data is from matrix. I have changed one line of the example, and now it can work for the graph made from worksheet. Please try the following code.
void TurnOffSpeedMode()
{
GraphLayer gl = Project.ActiveLayer();
if(gl)
{
Tree trFormat;
trFormat = gl.GetFormat(FPB_ALL, FOB_ALL, TRUE, TRUE);
// TreeNode trSpeed = trFormat.Root.Speed.Matrix;
// if the plot data is from worksheet,
// use the following line instead of the line above
TreeNode trSpeed = trFormat.Root.Speed.Worksheet;
if( !trSpeed )
return;
if( trSpeed.nVal )
{
trSpeed.nVal = 0;
if( gl.ApplyFormat(trFormat, TRUE, TRUE) )
out_str("Turn off speed mode!");
}
else
{
out_str("Speed mode already be turn off!");
}
}
}
Penn