REM simple bar chart REM arbitrary numbers only dim d[10],l$[10] array.load d[],15,25,8,35,40,20 array.load l$[],"Africa","Europe","Australia","Asia","America","Arctica" t$="World Energy Resources [PWh]" FN.DEF bar(x1,y1,x2,y2,d[],l$[],title$,xo,yo) dx=abs(x2-x1) : dy=abs(y2-y1) : dy2=0.15*dy array.max max,d[] array.length l,d[] bw=dx/(l*4) g=50 gr.color 255,g,g,g,1  gr.rect gn,x1-xo-2,y1-yo-dy2-2,x2-xo+2,y2-yo+2 gr.color 255,255,255,255,0 gr.set.stroke 2 gr.rect gn,x1-xo-2,y1-yo-dy2-2,x2-xo+2,y2-yo+2 xspace=(x2-x1)/l gr.text.size dy/15 gr.text.align 2 for i=1 to l gr.color 255,0,0,255,1 t$=l$[i] bh=d[i]*dy/max gr.rect gn,x1-xo+xspace*(i-0.5)-bw,y2-yo-bh,x1-xo+xspace*(i-0.5)+bw,y2-yo-2 gr.color 255,255,255,255,1 gr.line gn,x1-xo+xspace*(i-0.5),y2-yo+10,x1-xo+xspace*(i-0.5),y2-yo gr.text.draw gn,x1-xo+xspace*(i-0.5),y2-yo+dy/10,t$ t$=str$(round(d[i],1)) gr.text.draw gn,x1-xo+xspace*(i-0.5),y2-yo-0.05*dy,t$ next i gr.text.size dy/12 Gr.text.typeface 4,1 gr.text.draw gn,x1+dx/2-xo,y1-yo-10,title$ FN.END gr.open 255,0,0,0,0,-1 GR.SCREEN w,h x_offset=0 : y_offset=0 call bar(50,100,700,400,d[],l$[],t$,x_offset,y_offset) gr.render do pause 50 until 0