Add background image to library
Create a style for page
Create a style for the yBar graph
Create a style for the box,
Create a Variables YVal, XVal and Count
Define a page named "pageName" with style "pageStyle"
Create Graph 420,210 at 240, 145
Create Box 420, 210 at 240, 145 acts as a border of the graph
Create Page loop that runs forever
Calculate a Random value from 0 to 200 into YVal
Draw y bar graph at XVal,YVal
Increment XVal by 21
Add a wait so you can see graph drawing
Increment count by 1
Check count value if equals 10 reset XVal and change graph colour
Check count value if equals 20 reset XVal and count and change graph colour
After loading show the page
|
LIB(background,"SDHC/bground.png");
STYLE(pageStyle,Page) {image=background;}
STYLE(gstyle,DRAW) {type=ybar;col=darkslateblue;width=20;curRel=CC;yorigin=20;}
STYLE(bstyle,DRAW) {type=b;col=White;width=0;}
VAR(YVal,10,U8);VAR(XVal,1,U16);VAR(Count,0,U8);
PAGE(pageName, pageStyle)
{
DRAW(graph1,420,200,gstyle,240,146);
LOOP(graph,FOREVER)
{
CALC(YVal,200,"RND");
DRAW(graph1,XVal,YVal);;
CALC(XVal,XVal,21,"+");
WAIT(100);
CALC(Count,Count,1,"+");
IF(Count=10?[LOAD(XVal,1);RESET(graph1);LOAD(gstyle.col,darkgreen);]);
IF(Count=20?[LOAD(XVal,1);RESET(graph1);LOAD(gstyle.col,darkslateblue);LOAD(Count,0);]);
}
}
SHOW(pageName);
|