Post Reply 
Plot Values from a List Gen. by Program
01-14-2015, 10:32 PM
Post: #4
RE: Plot Values from a List Gen. by Program
Here is a code fragment you might like to review. It might serve as a building block for your own specific needs. (It's just a quick framework, not a complete charting program). The layout allows space to accommodate soft keys (Drawmenu) below, if you wanted to include it. X and Y pixels are equal for this example.

Code:

EXPORT XYChart()
BEGIN
LOCAL t,x;

RECT();                                // Clear figure

LINE_P(51,4,51,214,RGB(128,128,128));                 // v spine:  from 4 to 214 pixels, 210 pixels long
LINE_P(51,109,261,109,RGB(128,128,128));            // h spine:  from 51 to, 261 pixels,  210 pixels wide
TEXTOUT_P("Your Data",263,105,1,RGB(128,128,128));  
          
for t from 4 to 214 step 210/10 do                           // V subticks,  4 pixels wide             
  LINE_P(49,t,53,t,RGB(128,128,128));              
  TEXTOUT_P((-t+109)/105,30,t-4,1,RGB(128,128,128));  // Annotate V-Axis
end;

x:=1;
for t from 51 to 261 step 210/10 do                    // H subticks. 4 pixels wide
  LINE_P(t,107,t,111,RGB(128,128,128));
  x:=NOT(x);
  if x then TEXTOUT_P((t-156)/105,t-4,113,1,RGB(128,128,128)); end;    // Annotate H-Axis  
end;                                                                                                  // H subticks

FREEZE;

RETURN; 
END;

Good luck!

-Dale-
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Plot Values from a List Gen. by Program - DrD - 01-14-2015 10:32 PM



User(s) browsing this thread: