DGS Graph v0.9.0 (02/19/01) - http://www.digitalgenesis.com

Quick Install:

  0. Untar the distribution into your websites tree. It will create a dgsgraph
     directory. Several examples follow:

     For .tar.gz files:
       tar xvzf dgsgraph-0.9.0.tar.gz
        -or-
       zcat dgsgraph-0.9.0.tar.gz | tar xvf -

     For .tar.bz2 files:
       tar xvIf dgsgraph-0.9.0.tar.bz2
        -or-
       tar xvf dgsgraph-0.9.0.tar.bz2 --with-compress-program=bzip2
        -or-
       bzcat dgsgraph-0.9.0.tar.bz2 | tar xvf -

     For .zip files:
       pkunzip -x dgsgraph-0.9.0.zip
        -or-
       Use WinZip or other GUI zip program.

  1. Open and configure config.php as needed (in the config directory).
     Most options are described to the right of the option.

     A simple example will be displayed if no changes are made, and GD supports
     PNG images. There are also GIF images available in the images directory.

     NOTE: If you are using a Windows platform, please make sure you are
           using two backslashes in all paths (ie: config\\config.php).

  2. Test your install by using your browser to access dgsgraph.php.

     NOTE: If you have SAFE MODE enabled, you will need to make sure the files
           that DGS Graph will be reading are owned by the user that your web
           server is running as. For more information on SAFE MODE, see the
           PHP documentation.

Configuration:

  config.php - This file contains all configuration options for DGS Graph.

  Below is a full list of options and descriptions of how they work:

  General Options
  ---------------

    $config['title'] - Datatype: (String) - Ex: 'Network Availability and Latency'

      The title used on the page displayed by DGS Graph.


    $config['titleColor'] - Datatype: (String) - Ex: 'black'

      The color of the title used on the page displayed by DGS Graph.


    $config['srcFile'] - Datatype: (String) - Ex: 'images/my_background.png'

      The filename of the image used as the backdrop for the graph.


    $config['destFile'] - Datatype: (String) - Ex: 'images/output.png'

      The filename of the destination image that DGS Graph generates.


    $config['lastUpdate'] - Datatype: (Boolean) - Ex: true

      Display the last time the data source was updated, if its source is a file.


    $config['lastUpdateColor'] - Datatype: (String) - Ex: '444444'

      The color of the last updated string on the page displayed by DGS Graph.


    $config['font'] - Datatype: (String) - Ex: 'Arial, Sans-Serif, Helvetica'

      The font, or list of fonts used on the page displayed.


    $config['debug'] - Datatype: (Boolean) - Ex: false

      If set to true, debugging information will be displayed on the graph.
      This can often help center your data/text and track down configuration errors.


    $config["hideCredits"] - Datatype: (Boolean) - Ex: false
 
      If set to true, the string "DGS Graph" and link to our site will be
      removed from the bottom of the results page. We would like to ask that
      you leave this option set to false, as makes it easy for others to
      locate DGS Graph.


  Line Options
  ----------------

    NOTE: The 'x' in $line[x]['keyword'] should be replace with a descriptive value
          such as 'MilwaukeToChicago', or 'MilwaukeeToNewYork'. Each line in your
          graph will need to use a unique value here. In addition 'default' can be
          used. This is a special value that will allow you to specify default values
          for all lines. Lines can override the defaults.

    $line[x]['points'] - Datatype: (Array) - Ex: array(10,15,300,320);

		Points are your (x,y) and (x2,y2) point pairs. These are points on your
      $config['srcFile'] with the upper-left corner being (0,0).

      In the example above (x,y) is (10,15) and (x2,y2) is (300,320).

      As a general rule, put your points in an order such that x < x2 or you
      may need to enable $line[x]['flipY'] to have your data/text displayed
      properly.


    $line[x]['desc'] - Datatype: (String) - Ex: 'Latency between Milwaukee and Chicago.'

       The description is used as an aid to the maintainer of config.php. Currently, it
       isn't used or displayed by DGS Graph.


    $line[x]['source'] - Datatype: (String) - Ex: 'log/example.log'

       The data source that you are graphing. This command will accept
       a filename or a script with 'EXEC:' prepended. In the future, we
       would like to add a database source as well.

       If your data source is a log file, data must be separated by newlines.

       The following is an example of calling a script:

          $line['default']['source'] = 'EXEC:contrib/example.sh';

       NOTE: Script sources will not work when SAFE MODE is enabled. It also
             will not work on Win9x/NT/2000 platforms.


    $line[x]['index'] - Datatype: (Integer) - Ex: -1

      The index or line number from the data source that this line will use as
      its data. If this value is set to -1, it will use the internal auto-index
      which steps through your data source one line at a time.


    $line[x]['dashed'] - Datatype: (Boolean) - Ex: false

      If set true, this line on the graph will be dashed rather than solid.


    $line[x]['hidden'] - Datatype: (Boolean) - Ex: false

      If set true, this line will be hidden or not displayed. This is useful for
      disabling a line without having to remove it from the config.


    $line[x]['font'] - Datatype: (Integer) - Ex: 3

      The font used to display data/text. Currently values from 0-5 work. These
      numbers refer to PHPs built in fonts.


    $line[x]['label'] - Datatype: (String) - Ex: ' ms'

      The label will be appended to your data/text for this line.


    $line[x]['fontHeight'] - Datatype: (Integer) - Ex: 12

      The font height is used to center the font. Fonts are normally displayed
      starting its upper-left corner, which will make the display look off center.

      You can enable $config['debug'] to help aid in setting the correct value here.
      You will see a set of rectangles. The center line in these rectangles should cut
      directly through the middle of your font.

      For a font of 3, the correct value font height is 12.


    $line[x]['lineColor'] - Datatype: (String/Array) - Ex: array('green', 30, 'red')

      If this value is set to a string, the specified color will always be used to
      graph the specified line. This works exactly the same as 'textColor'.

      If this value is an array, the color of the line will can change as thresholds
      are broken. There is a format for this array that must be followed. The first
      value listed in the array is the default color. The second and third values
      are a threshold followed by a color. They must always come in pairs. You may
      list as many pairs as you like.

      Below is a longer example followed by an explanation:

         $line['defaut']['lineColor'] = array('green', 10, 'yellow', 20, 'red');

         The default color here is 'green'. If the data source has a value larger
         than 10, then the color will become 'yellow'. If the value is larger
         than 20, then the color will become 'red'.

      NOTE: The colors used here must be listed in the $colors[] constant at the
            end of the config. You may also use RBG values in hex to specify a
            color such as '00ff00'.


    $line[x]['textColor'] - Datatype: (String/Array) - Ex: 'black'

      If this value is set to a string, the specified color will always be used to
      graph the specified line. This works exactly the same as 'lineColor'.

      If this value is an array, the color of the line will can change as thresholds
      are broken. There is a format for this array that must be followed. The first
      value listed in the array is the default color. The second and third values
      are a threshold followed by a color. They must always come in pairs. You may
      list as many pairs as you like.

      Below is a longer example followed by an explanation:

         $line['defaut']['textColor'] = array('green', 10, 'yellow', 20, 'red');

         The default color here is 'green'. If the data source has a value larger
         than 10, then the color will become 'yellow'. If the value is larger
         than 20, then the color will become 'red'.

      NOTE: The colors used here must be listed in the $colors[] constant at the
            end of the config. You may also use RBG values in hex to specify a
            color such as '00ff00'.


    $line[x]['radius'] - Datatype: (Integer) - Ex: 8

      The radius is the distance your data/text should be displayed from the center
      of the line.

      DGS Graph prefers to graph data/text to what it believes is the upper-right of
      a line. If placement of your data/text isn't as desired, your points may be
      reverses. You can swap your (x,y) and (x2,y2) points, or set $line[x]['flipY']
      to true to correct this.


    $line[x]['flipY'] - Datatype: (Boolean) - Ex: false

		If set true, the polarity of the y coordinate will be swapped, resulting in
      your data/text being graphed in a different location.

      DGS Graph prefers to graph data/text to what it believes is the upper-right of
      a line. If placement of your data/text isn't as desired, your points may be
      reverses. You can swap your (x,y) and (x2,y2) points, or set $line[x]['flipY']
      to true to correct this.

      You can enable $config['debug'] to help aid in setting the correct value here.
      You will see a red dot at the center of the line. There will another red line
      originating from this dot. If it isn't perpendicular to your line, you may
      need to enable this option, or reverse your points.


   Constants
   ---------

   NOTE: These options generally don't need to be changed.

    $config['program'] - Datatype: (String) - Ex: 'DGS Graph'

      The name of this program.


    $config['version'] - Datatype: (String) - Ex: 'v0.9.0'

      The current version of this program.


    $colors[x] - Datatype: (String) - Ex: 'ff0000'

      The listed colors are used to make aliases for the RGB values. The 'x' above
      is the alias, and the value is the real RGB color in hex.
