Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Library for Clipper - <b>l_axes()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
                                 L_AXES()


Syntax:        L_AXES(<expN1>,<expN2>,<expN3>,<expN4>,
               <array1>,<array2>,<expN5>,<expN6>)


Purpose:       To draw axes on the screen with scaling and labels for
               use with graphing functions.


Arguments:     <expN1> is the x co-ordinate of the upper left corner
               of the axes.

               <expN2> is the y co-ordinate of the upper left corner
               of the axes.

               <expN3> is the x co-ordinate of the lower right corner
               of the axes.

               <expN4> is the y co-ordinate of the lower right corner
               of the axes.

               <array1> is an array of labels to be attached to the
               vertical axis.

               <array2> is an array of labels to be attached to the
               horizontal axis.

               <expN5> is the color code number for the color of the
               axes.

               <expN6> is the color code number for the color of the
               labels.


Returns:       Nothing.



Usage:         To provide labelled and scaled axes for use with
               graphs.


Examples:      DECLARE arr_h1[12]
               && array of horizontal co-ords
               DECLARE arr_v1[12]  && array of vertical co-ords
               DECLARE arr_v2[12]  && array of vertical co-ords
               DECLARE labs_v[4]   && array of labels for vert axis
               DECLARE labs_h[12]  && array of labels for horiz axis

               startx = 150   && x coord top left corner
               starty = 50    && y coord top left corner
               endx = 450     && x coord bottom left corner
               endy = 550     && y coord bottom left corner
               months="JanFebMarAprMayJunJulAugSepOctNovDec"

               FOR i = 1 TO 12     && assign values to horiz co-ords
                  arr_h1[i] = i-1
               NEXT

               arr_v1[1] = 7  && assign values to first set
               arr_v1[2] = 8  && of vertical co-ords
               arr_v1[3] = 7
               arr_v1[4] = 6.5
               arr_v1[5] = 6
               arr_v1[6] = 7
               arr_v1[7] = 4.5
               arr_v1[8] = 6
               arr_v1[9] = 6.5
               arr_v1[10] = 10
               arr_v1[11] = 9
               arr_v1[12] = 10

               arr_v2[1] = 2  && assign values to second
               arr_v2[2] = 4  && set of vertical co-ords
               arr_v2[3] = 6
               arr_v2[4] = 6
               arr_v2[5] = 10
               arr_v2[6] = 8
               arr_v2[7] = 6
               arr_v2[8] = 4
               arr_v2[9] = 2
               arr_v2[10] = 4
               arr_v2[11] = 6
               arr_v2[12] = 8

               labs_v[1] = "0"     && assign values to
               labs_v[2] = "5"     && vertical labels
               labs_v[3] = "10"
               labs_v[4] = "15"

               FOR i = 1 TO 12     && assign values to horiz labs
                  labs_h[i] = SUBSTR(months, ((i-1)*3)+1, 3)
               NEXT

               L_GMODE(18)
               L_TSIZE(2)
               L_TEXT("Planet Software - Sample - XY Graph",1,150,100,2,0)
               L_XYGRAPH(startx,starty,endx,endy,1,11,15,arr_h1,;
                    arr_v1,14,4,arr_h1,arr_v2,4,5)
               L_AXES(startx,starty,endx,endy,labs_v,labs_h,2,3)


Language:      C

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson