Add background image to library
Create page style
Create a trace graph style
Create variables for X Y
Create variables for XS XS2
Create variables for Col and Col2
Define a page named "pageName" with style "pSt"
Create a graphs
Create graphF
Creates a loop that runs 91 times
Calculates XS by adding random number to X
Calculates Y value by SIN the XS
Multiplies Y by 70
Adds 95 to Y
draw graph at X Y
Take 20 from Y
Add 10 to X
Draw graph at X Y
Take 8 from X
Reset X value
Run graphF function
After loading show the page named "pageName"
|
LIB(background,"SDHC/bground.png");
STYLE(pSt, Page) {image=background;}
STYLE(gSt,DRAW){type=trace;col=navy;width=1;}
STYLE(gSt2,DRAW){type=trace;col=navy;width=2;}
VAR(Y,0,FLT4);VAR(X,0,U16);
VAR(XS,0,U16);VAR(XS2,0,U16);
VAR(Col,\\008045,U32);VAR(Col2,\\003045,U32);
PAGE(pageName,pSt)
{
DRAW(graph1,400,190,gSt,250,140);
DRAW(graph2,400,190,gSt2,250,140);
DRAW(graph3,400,190,gSt2,250,140);
}
FUNC(graphF)
{
LOOP(Loop1,91)
{
CALC(XS,2,X,"*");
CALC(XS2,180,XS,"+");
CALC(Y,XS, "SIN" );
CALC(Y,Y,60,"*");
CALC(Y,Y,95,"+");
CALC(Col,Col,2,"+");LOAD(gSt.col,Col);
CALC(Col2,Col2,2,"+");LOAD(gSt2.col,Col2);
DRAW(graph1,X,Y);DRAW(graph2,X,Y);
CALC(Y,XS2,"SIN" );
CALC(Y,Y,60,"*");
CALC(Y,Y,100,"+");
CALC(X,X,15,"+");
DRAW(graph1,X,Y);DRAW(graph3,X,Y);
CALC(X,X,11,"-");
}
}
RUN(graphF);
SHOW(pageName);
|