phpChartLib - Release 1.0 - Documentation

phpChartLib 1.0 - Copyright 2006 Andreas Schwarzkopf
You may use phpChartLib Version 1.0 for private and commercial projects unlimited, as long as you will name and link the project homepage http://www.as-hu.de/phpchartlib in your webpage imprint. You're allowed to change whatever you want for your purposes, but you are not allowed to spread altered sourcefiles or documentations. This documentation must be included in every phpChartLib bundle. The sourcecode comes with absolutely no warranty at all.
Since it is a hard and time consuming work to develope any kind of software, you're welcome to contribute the author - especially if you like phpChartLib, it would be fair to drop a few lines and let us know if you can afford to donate a few bucks for server and developement costs. Every little encouragement would be highly appreciated.
 

 

Content

  phpChartLib - Release 1.0 - Documentation
      Content

    Working with PHPChartLib . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      About PHPChartLib  . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      Overview Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      The common idea  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
        Easy (non working) example . . . . . . . . . . . . . . . . . . . . . . . goto this section
        Demo environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
        Easy (working) example . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
        Different ChartSpecs . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      General Specification  . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
        Easy example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
        Advanced example . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      Summary  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section

    phpChartLib 1.0 - Reference  . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      ChartSpecification . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      Color  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      ChartDataTriple  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      BarChartSpecification  . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      BarChart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      PieChartSpecification  . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      PieChart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      PointChartSpecification  . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      PointChart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      LineChartSpecification . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
      LineChart  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . goto this section
 

 

 

 

Working with PHPChartLib

About PHPChartLib

The PHPChartLib Project shall provide you a simple, clean and easy to use library for generating charts. Although the first version of the code was written using php3, it is now implemented completely object oriented and should be easy to understand.

I know that there are a few minor disfigurements (e.g. php5 and above versions are using __construct() as the constructor's name, while lower php versions are using the classname) - but since the newer php versions should be tolerant and more or less compatible with older code,.. well never mind, i guess it'll work.

In order to let you have a rather successful approach to the functionalities of this library, i'd like to explain to you very shortly all you need to know about and how to use the different classes found in this project.

Overview: Classes

So far i've implemented a bar, pie, point and a line chart. If i should invent more chart types in the future, they will follow the same pattern described in the next few sections. After including the PHPChartLib/chartlib.php file you have access to the following Class Definitions:

  • ChartSpecification
  • Color
  • ChartDataTriple
  • BarChartSpecification
  • PieChartSpecification
  • PointChartSpecification
  • LineChartSpecification
  • BarChart
  • PieChart
  • PointChart
  • LineChart

    The classes Color and ChartDataTriple are wrapper classes for color- and the actual chartdata. Wherever a color must be specified, be aware to use the Class "Color" which is designed to hold a full RGB Color-triple.

  • The common idea

    Generating any type of chart will always be a process of three major steps:

    1 - Specify the general chart data (ChartSpecification Object)
    2 - Define attributes for the aspired Chart ([XYZ]ChartSpecification Object)
    3 - Generate the actual chart ([XYZ]Chart Object)

    As you should have recognize by now: The classes are designed exactly for those steps - so generating a chart with PHPChartLib will always require these three objects:


    - ChartSpecification Object
    - [XYZ]ChartSpecification Object
    - [XYZ]Chart Object

    The ChartSpecification Object will hold common information (e.g. the data we want to present, the background color or the dimensions) about the chart - no matter if we want to build a bar-, pie or whatever chart else, this will always be the first step.

    After those general settings we will create a [XYZ]ChartSpecification Object and then the Chart specific propertys will be applied onto it.
    For example: We could call myLineChartSpecification->setLineThickness(3) or myPieChartSpecification->set3D(1.0, 0.6, 1) to apply these chart specific properties.

    The last step will be the construction of the actual [XYZ]ChartObject. By calling the constructor we will pass it the general ChartSpecification Object as well as the [XYZ]ChartSpecification Object. By now we're nearly finished:
    We have a fully configured Chart Object for our aspired [XYZ] Chart and can call the drawing method: [XYZ]Chart->draw();

    Easy (non working) example
    As all the objects will set up their internals with standard values we could generate an empty bar chart with just 4 lines of code:
    1.$myCS = new ChartSpecification(320, 240, 'My first Chart');
    2.$myBCS = new BarChartSpecification();
    3.$myBC = new BarChart($myCS, $myBCS);
    4.$myBC->draw();
    Well ok - you have to put this in the right place/context and so we will proceed with the next section.
    Demo environment
    We need the right "context" and therefore i assume the following configuration:

    In our working directory we have

  • File "index.htm" with content
    <html>
      <head><title>My Chart Text</title></head>
      <body>
        <img src="chart.php">
      </body>
    </html>

  • File "chart.php" with content
    <?php
      require_once("PHPChartLib/chartlib.php");
      // EXAMPLE CODE FOLLOWS...
    ?>

  • And of course the subfolder "PHPChartLib" - containing all the neccessary files.
  • Easy (working) example
    As i said, every chart will be based on a general ChartSpecification, so the first step ever is to provide a proper initialized ChartSpecification Object. After that you initialize a chartspecific information object and then provide those two to the chartobject of your choice...
    I guess the idea got clear by now.

    If i assume the environment mentioned above, replacing the line "// EXAMPLE CODE FOLLOWS" with the commands of the "easy example" section will give you:

    "chart.php"
    <?php
      require_once("PHPChartLib/chartlib.php");
      $myCS  = new ChartSpecification(320, 240, 'My first Chart');
      $myBCS = new BarChartSpecification();
      $myBC  = new BarChart($myCS, $myBCS);
      $myBC->draw();
    ?>

    And requesting "index.htm" will result in something like this:

    Now we need to get into more detail with the two wrapper classes Color and ChartDataTriple:
    The Class Color should be nearly self-explaining, and it is used to encapsulate the three color components R, G and B (Red, Green, Blue).
    It usually gets initialized via the constructor and won't change during its lifetime:

    $myRedColor = new Color(255, 0, 0);

    The Class ChartDataTriple is used to to hold one Data-Record at a time. A Data Record consists of a boolean flag (whether it is a valid datarecord), its actual value, a color which will be used to visualize the value in the later chart and a description.
    The value should be numeric, the color is supposed to be a Color Object and the Description should be a String.
    The boolean should be set to true if the value you're passing is valid. (In some cases - maybe you're reading data from a database or from somewhere else - you just can't provide the proper value, but still want to insert it without passing a "0". This way you can indicate via the boolean that you have nothing rather than 0. More on this later...)

    $myDataTriple = new ChartDataTriple(true, 50, $myRedColor, "foo_bar");

    As a data triple is independent of its future representation, chartlib is designed to collect the data in the ChartSpecification object. They can be passed via the addDataTriple method. Lets take a look at our modified example code:

    "chart.php" with
    <?php
      require_once("PHPChartLib/chartlib.php");
      $myCS  = new ChartSpecification(320, 240, 'My first Chart');
        $myCS->addDataTriple(new ChartDataTriple(true, 25, new Color(255, 0 , 0), 'V_1'));
        $myCS->addDataTriple(new ChartDataTriple(true, 75, new Color(0, 255 , 0), 'V_2'));
        $myCS->addDataTriple(new ChartDataTriple(true, 50, new Color(0, 0 , 255), 'V_3'));
      
      $myBCS = new BarChartSpecification();
      $myBC  = new BarChart($myCS, $myBCS);
      $myBC->draw();
    ?>

    Different ChartSpecs
    Just to give you a feeling why i decided to seperate the functionalities the way i did: If you replace the last 3 commands with the appropriate pie commands you get:

    "chart.php" with
    <?php
      require_once("PHPChartLib/chartlib.php");
      $myCS  = new ChartSpecification(320, 240, 'My first Chart');
        $myCS->addDataTriple(new ChartDataTriple(true, 25, new Color(255, 0 , 0), 'V_1'));
        $myCS->addDataTriple(new ChartDataTriple(true, 75, new Color(0, 255 , 0), 'V_2'));
        $myCS->addDataTriple(new ChartDataTriple(true, 50, new Color(0, 0 , 255), 'V_3'));
        
      $myPCS = new PieChartSpecification();
      $myPC  = new PieChart($myCS, $myPCS);
      $myPC->draw();
    ?>

    General Specification

    No matter what kind of chart we're going to generate, we can always set the following properties through the ChartSpecification Object:
  • the overall dimensions (width and height)
  • the headline / headlinesize
  • textcolor and size
  • background color
  • footertext and size
    (width, height and the headlinestring are initially set via the constructor, but can be redefined)

    Besides that, there are different methods for processing the data stored in the ChartSpecification Object.
    The most interesting ones are definitely linearInterpolate() which will do excatly that with all the datatriples set to be invalid and colorizeDataSet() which will colorize the datatriples in a smooth way.

    In the following example we generate a bunch of datatriples by random to show the desired effects.
    Example:

    Easy example
    <?php
      require_once("PHPChartLib/chartlib.php");
      $myCS = new ChartSpecification(640, 240, 'Colored Chart');
      $myCS->setText(new Color(255, 255, 255), 1);
      $myCS->setBackgroundcolor(new Color(0, 0, 100));
      $myCS->setFooter('Demo Chart', 1);
      for ($i = 0; $i < 20; $i++) {
        $rnd = rand()/getRandMax() * 100;
        $dt = new ChartDataTriple(true, $rnd, new Color(255, 0 , 0), 'V_1');
        $myCS->addDataTriple($dt);
      }
      $myCS->colorizeDataset3C(new Color(0, 255 , 0),
                               new Color(255, 255 , 0),
                               new Color(255, 0 , 0));
                               
      $myBCS = new BarChartSpecification();
      $myBC = new BarChart($myCS, $myBCS);
      $myBC->draw();
    ?>

    Advanced example
    Now we will produce a more sophisticated example by playing around with the propertys of the bar chart:

    <?php
      require_once("PHPChartLib/chartlib.php");
      $myCS = new ChartSpecification(640, 260, 'Colored Chart');
      $myCS->setText(new Color(255, 255, 255), 1);
      $myCS->setBackgroundcolor(new Color(0, 0, 120));
      $myCS->setFooter('Demo Chart', 1);
      for ($i = 1; $i <= 30; $i++) {
        $rnd = rand()/getRandMax() * 100;
        $dt = new ChartDataTriple(true, $rnd, new Color(255, 0 , 0), "V $i");
        $myCS->addDataTriple($dt);
      }
      $myCS->colorizeDataset3C(new Color(0, 255 , 0),
                               new Color(255, 255 , 0),
                               new Color(255, 0 , 0));
                               
      $myBCS = new BarChartSpecification();
      $myBCS->setBackgroundcolors(new Color(0, 0, 160), new Color(0, 0, 180));
      $myBCS->set3D(true, new Color(0, 0, 120), 20, 10);
      $myBCS->setGrid(2, 1, new Color(0, 0, 0), new Color(0, 0, 0));
      $myBCS->setAxis(0, 100, 10, new Color (0, 0, 0), '', '');
      $myBCS->setBarstyle(0.4, 1);
      $myBCS->setValuesVisible(true);
      
      $myBC = new BarChart($myCS, $myBCS);
      $myBC->draw();
    ?>

    And the same with a Pie Chart:

      require_once("PHPChartLib/chartlib.php");
      $myCS = new ChartSpecification(480, 260, 'Colored Pie Chart');
      $myCS->setText(new Color(255, 255, 255), 2);
      $myCS->setBackgroundcolor(new Color(0, 0, 120));
      $myCS->setFooter('Demo Chart', 1);
      for ($i = 1; $i <= 5; $i++) {
            $rnd = rand()/getRandMax() * 10 + 5;
            $dt = new ChartDataTriple(true, $rnd, new Color(255, 0 , 0), "Value $i");
            $myCS->addDataTriple($dt);
      }
      $myCS->colorizeDataset3C(new Color(0, 255 , 0),
                               new Color(255, 255 , 0),
                               new Color(255, 0 , 0));
                               
      $myPCS = new PieChartSpecification();
      $myPCS->setBackgroundcolors(new Color(0, 0, 220), new Color(0, 0, 180),
                                  new Color(0, 0, 140), new Color(40, 40, 100));
      $myPCS->set3D(1.0, 0.5, 20);
      $myPCS->setBorder(new Color(0, 0, 0));
      $myPCS->setPie(1.0, 0, 30);
      $myPCS->setDrawport(true, false, false, 1.2);
      $myPCS->setLegendTextGap(6);
      
      
      $myPC = new PieChart($myCS, $myPCS);
      $myPC->draw();
    ?>

  • Summary

    If you've played and messed around a bit, you should know by now how to generate charts using PHPChartLib. If you want to follow a guideline through the whole process you might find the following checklist useful.

    Three Steps to get your Chart - now in detail:

    1 Specify the general chart data:
      1.1   Create an Object from the class ChartSpecification
      1.2   Initialize it via constructor and/or proper set-functions
      1.3   Fill it with chart data
      1.3.1     Create Objects from the class ChartDataTriple
      1.3.2     Initialize them via constructor and/or proper set-functions
      1.3.3     add those ChartDataTriple-Objects to the ChartSpecification-Object
     
    2 Specify additional informations for the aspired Chart
      2.1   Create a [XYZ]ChartSpecification Object
      2.2   Initialize it via constructor and/or proper set-functions
     
    3 Generate the actual chart based on those two SpecificationObjects
      3.1   Create a [XYZ]ChartObject
      3.2   Pass it the ChartSpecification Object (via constructor)
      3.3   Pass it the [XYZ]ChartSpecification Object (via constructor)
      3.4   Call it's draw method

    phpChartLib 1.0 - Reference


    ChartSpecification

    Constructor:
    ChartSpecification($width, $height, $headline = '')
        Expects two positive integer values and a string.
        The integers determine the size of the generated chartimage,
        the string will be set as the headline.
        
    Functions intended for public use:
    setDimensions($width = 200, $height = 100)
        Expects two positive integer values.
        Determines the size of the generated chartimage.
        
    setHeadline($headline = '', $headlinesize = 4)
        Expects a string and the font size as an integer value (valid image
        fontsizes are 1 to 5). This will be the main headline of the chart.
        
    setText($color, $size = 1)
        Expects the color as a Color-object and the font size as an integer
        value (valid image fontsizes are 1 to 5). This will be the default
        font size and color in the chart.
        
    setBackgroundcolor($color)
        Expects the color as a Color-object. This will be the main background
        color.
        
    clearDataTriples()
        This will cause the ChartSpecification Object to internally release
        all managed ChartDataTriple-objects.
        
    countDataTriples()
        This will return an integer counting the internally managed
        ChartDataTriple Objects.
        
    addDataTriple($triple)
        This will add the given ChartDataTriple object to the queue of
        internally managed objects.
        
    getDataTriple($index)
        Index must be between 0 and countDataTriples()-1. It will return the
        corresponding ChartDataTriple object.
        
    setFooter($footer = '%t %d', $footersize = 1)
        Expects the footer as a String and the footer font size as an integer
        value (valid image fontsizes are 1 to 5). If the footer-String
        contains %t or %d these values will be replaced with the actual time
        or date. The standard footer is 'generated: %d %t by PHPChartLib'
        with fontsize 1.
        
    absAll()
        Will cause the ChartSpecification to iterate through all internally
        managed ChartDataTriples, replacing negative values with positive
        ones (internally using abs()).
        
    roundAll()
        Will cause the ChartSpecification to iterate through all internally
        managed ChartDataTriples, replacing all values with their rounded
        values (internally using round()).
        
    floorAll()
        Will cause the ChartSpecification to iterate through all internally
        managed ChartDataTriples, replacing all values with their floored
        values (internally using round()). (floor = round to the next lower
        integer. i.e. floor(4.2) = 4; floor(5.9) = 5)
        
    sumAll()
        Will return the sum of all internally managed ChartDataTriple values.
        (If you need this value more than once, you should save it in a
        variable rather than calling the method too often. The
        ChartSpecification will iterate through all internally managed
        ChartDataTriples, and process their values - and that can be quite
        expensive.)
        
    prodAll()
        Will return the product of all internally managed ChartDataTriple
        values.
        (If you need this value more than once, you should save it in a
        variable rather than calling the method too often. The
        ChartSpecification will iterate through all internally managed
        ChartDataTriples, and process their values - and that can be quite
        expensive.)
        
    scaleAll($scaling_coefficient)
        Expects the scaling factor as a numeric value (int or float).
        The ChartSpecification will iterate through all internally managed
        ChartDataTriples, and scale (multiply) their values with the given
        scaling_coefficient.
        
    avg()
        Will return the average of all internally managed ChartDataTriple
        values.
        (If you need this value more than once, you should save it in a
        variable rather than calling the method too often. The
        ChartSpecification will iterate through all internally managed
        ChartDataTriples, and process their values - and that can be quite
        expensive.)
        
    variance()
        Will return the variance of all internally managed ChartDataTriple
        values.
        (If you need this value more than once, you should save it in a
        variable rather than calling the method too often. The
        ChartSpecification will iterate through all internally managed
        ChartDataTriples, and process their values - and that can be quite
        expensive.)
        
    stdDeviation()
        Will return the standard deviation of all internally managed
        ChartDataTriple values.
        (If you need this value more than once, you should save it in a
        variable rather than calling the method too often. The
        ChartSpecification will iterate through all internally managed
        ChartDataTriples, and process their values - and that can be quite
        expensive.)

    linearInterpolate()
        This will cause the ChartSpecification to iterate through all
        internally managed ChartDataTriple objects, replacing the values
        of invalid marked ones with the linear interpolated values given by
        valid neighboring ChartDataTriples.
        
    convertToDerivation()
        This will try to build a derivation dataset. The ChartSpecification
        will iterate through all n managed ChartDataTriple objects i and will
        replacing the first n-1 ones with Value(i+1) - Value(i).
        The n-th Dataset will be discarded.
        To achive good results it might be useful to scale before or after you
        used this function (see scaleAll()).
        Remember to provide at least 2 ChartDataObjects before calling this
        function.
        
    getMaxValue()
        This will cause the ChartSpecification to iterate through all
        internally managed ChartDataTriple objects and determine the maximum
        of the stored (valid) values.
        (If you need this value more than once, you should save it in a
        variable rather than calling the method too often. The
        ChartSpecification will iterate through all internally managed
        ChartDataTriples, and process their values - and that can be quite
        expensive.)
        
    getMinValue()
        This will cause the ChartSpecification to iterate through all
        internally managed ChartDataTriple objects and determine the minimum
        of the stored (valid) values.
        (If you need this value more than once, you should save it in a
        variable rather than calling the method too often. The
        ChartSpecification will iterate through all internally managed
        ChartDataTriples, and process their values - and that can be quite
        expensive.)

    colorizeDataset2C($color1, $color2)
        Expects the provided parameters to be Color objects.
        This will cause the ChartSpecification to iterate through all
        internally managed ChartDataTriple objects and colorize them with a
        smooth gradient from $color1 to $color2.
        The color depends on the position of the ChartDataTriple.
        
    colorizeDataset3C($color1, $color2, $color3)
        Expects the provided parameters to be Color objects.
        This will cause the ChartSpecification to iterate through all
        internally managed ChartDataTriple objects and colorize them with a
        smooth gradient from $color1 to $color3 over $color2.
        The color depends on the position of the ChartDataTriple.
        
    colorizeDataset2C_V($color1, $color2)
        Expects the provided parameters to be Color objects.
        This will cause the ChartSpecification to iterate through all
        internally managed ChartDataTriple objects and colorize them with a
        smooth gradient from $color1 to $color2.
        The color depends on the value of the ChartDataTriple.
        
    colorizeDataset3C_V($color1, $color2, $color3)
        Expects the provided parameters to be Color objects.
        This will cause the ChartSpecification to iterate through all
        internally managed ChartDataTriple objects and colorize them with a
        smooth gradient from $color1 to $color3 over $color2.
        The color depends on the value of the ChartDataTriple.


    Color

    Constructor:
    Color($r = 0, $g = 0, $b = 0)
        Expects three positive integer values between 0 and 255.
    Functions intended for public use:
    setRGB($r = 0, $g = 0, $b = 0)
        Expects three positive integer values between 0 and 255.
        The properties $myColor->r, $myColor->g and $myColor->b are intended
        to be used directly - i.e. there are no get() functions implemented.
        (They are meant to be "public" properties.)

    ChartDataTriple

    Constructor:
    ChartDataTriple($valid = false, $value = 0, $color = 0, $desc = '')
        Expects a boolean $valid, a numeric $value, a $color object and a
        $desc(ription) string.
        A data triple logically consists of a value, a color and a
        description. However there is a fourth parameter $valid.
        If valid is set to false, most charts won't interpret the value of
        chart datatriple. Sometimes it might be neccessary to generate a data
        triple object altough the correct value is not known at that time.
        By setting the valid flag to false you are able to generate the
        ChartDataTriple "container object" in advance.
        Besides that there are functions like linearInterpolate() which can
        try to insert appraised valid values for you.
    Functions intended for public use:
    getValid()
        Will return the corresponding value. A Chart Data Triple Object is a
        kind of "container object" and its properties are meant to be public.
        Using this get method is not neccessary.
    getValue()
        Will return the corresponding value. A Chart Data Triple Object is a
        kind of "container object" and its properties are meant to be public.
        Using this get method is not neccessary.
    getColor()
        Will return the corresponding value. A Chart Data Triple Object is a
        kind of "container object" and its properties are meant to be public.
        Using this get method is not neccessary.
    getDesc()
        Will return the corresponding value. A Chart Data Triple Object is a
        kind of "container object" and its properties are meant to be public.
        Using this get method is not neccessary.
    setValid($v)
        Will set the corresponding value. $v must be a boolean.
    setValue($v)
        Will set the corresponding value. $v must be numeric.
    setColor($c)
        Will set the corresponding value. $v must bw a Color object.
    setDesc($d)
        Will set the corresponding value. $d must be a string.


    BarChartSpecification

    Constructor:
    BarChartSpecification()
        Constructs a new BarChartSpecification object. Expects no parameters.
        
    Functions intended for public use:
    setBackgroundcolors($bg1, $bg2)
        Expects two Color Objects. The background of the chart will be
        alternating between those two colors.
        
    setGrid($grid_h_type, $grid_v_type, $h_color, $v_color)
        Expects two integers and two Color objects.
        $grid_h_type nad $grid_v_type should be 0 to be invisible or 2 to be
        solid lines. Some implementations can handle dashed lines which can be
        activated by using value 1.
        Example:
        $myBCS->setGrid(0, 2, new Color(0, 0, 0), new Color(255, 255, 255));
        Will generate only white vertical lines.
        
    setAxis($min, $max, $steps, $axiscolor, $x_desc, $y_desc)
        Expects 3 numeric values a Color object and two strings.
        $min and $max will be the minimum and maximum values of the y-axis.
        Be aware: They only take effect if autoscale is false!
        Steps will determine how many horizontal lines will be drawn.
        The Color will affect the appearance of the axis and the barborder.
        If you provide descriptionstrings for x- and y-Dimensions, they will be
        drawn on the corresponding axis.
        
    setAutoscale($autoscale, $mul_val, $add_val)
        Expects a boolean and two numeric values.
        If autoscale is true the internal autoscale mechanism will be enabled.
        Min and max values set by the function setAxis() will be ignored.
        Instead the min/max value of the axis will be determined by
        getMin/MaxValue() * $mul_val -/+ $add_val.
        For Example:
        If the ChartSpecification contains datatriples with values ranging from
        -10 to 90 calling setAutoscale(true, 1.0, 0.0) will scale the axis
        exactly from -10 to 90. Most of the times you use this function you
        will want to have maybe about 10% space, so you could call
        setAutoscale(true, 1.1, 0.0). Or maybe you have a dataset with values
        from -3 to 3. Calling setAutoscale(true, 1.0, 2.0) will result in an
        axis ranging from -5 to 5 (-3*1.0-2 to 3*1.0+2.0).
        Hint: If you want to take full control over the axis, you shouldn't call
        setAutoscale at all, but rather take care o the min and max values you
        inserted into the specification an set the proper values by yourself
        using the setAxis() function.

    setBarstyle($barwidth, $barborderwidth)
        Expects two numeric values. $barwidth should be between 0.0 and 1.0 and
        determines how much space a single bar will use (1.0 will take 100% of
        the available space). $barborderwidth is per default set to 1 and should
        be an integer value.
        
    set3D($bottom3d_on, $bottomcolor, $depth3dx, $depth3dy)
        Expects a boolean value, a Color object and two integervalues.
        If $bottom3d_on is set to true, a bottom rectangle will be dran in the
        color specified by the $bottomcolor object. $depth3dx and $depth3dy
        should be positive integer values and regulate the 3d appearance of
        the bars.
        
    setValuesVisible($showvalues)
        Expects a boolean. If set to true, the values will be printed above
        the bars.

    BarChart

    Constructor:
    BarChart($general_spec, $chart_spec)
        The first parameter should be a ChartSpecification Object, the second
        one a BarChartSpecification Object. By providing these two Objects
        the constructed BarChart Object has all neccessary informations on how
        the barchart should look like.
        
    Functions intended for public use:
    draw()
        Calling this function finally causes the object to generate the desired
        chart.


    PieChartSpecification

    Constructor:
    PieChartSpecification()
        Constructs a new PieChartSpecification object. Expects no parameters.
    Functions intended for public use:
    setBackgroundcolors($bg1, $bg2, $bg3, $bg4)
        Expects four Color objects, which specify the backgroundcolor of the
        intrinsic chart, the background for the legend, the color of the
        legendtable and its "shadow" color.
        
    setBorder($bordercolor)
        Expects a Color object which specifies the bordercolor.
        
    set3D($depth_stretch_h, $depth_stretch_v, $thickness)
        Expects two numeric values which are used to simulate the 3 dimensional
        effect as well as an positive integer value $thickness used to define
        how thick the pie should be drawn.
        
    setDrawport($h_alignment, $legendfirst, $hidesecond, $proportion)
        Expects 3 booleans and a numeric value.
        A pie chart consists of two drawports: The first one contains the pie
        chart, the second one contains the legend. If $h_align is true, these
        drawports are aligned left-right else top-down. If $legendfirst is set
        true the first drawport (left or top, depending on $h_align) will
        contain the legend, the second one will contain the piechart.
        If $hidesecond is true only the first drawport will be rendered. This
        will get handy if you want to generate the piechart and its legend in
        two different pictures.
        The third parameter $proportion should be set to a numeric value between
        0.0 and 2.0. Standard is 1.0. This value will be multiplied with the
        first drawports size, so for example 1.2 will result in a 20% bigger
        first drawport. Most of the times a slightly higher value than 1.0 will
        create a nice Pie Chart as you will have a bit more space for the pie
        than for the legend.
        
    setPie($pie_scalefactor, $moved_seg, $moved_offset)
        Expects a positive numeric value, an integer value between 0 and
        chartSpecification->countDataTriples()-1 and a positive integer value.
        $pie_scalefactor's default value is 1.0, and will be multiplied onto
        the standard pie size in order to enlarge it's appearance.
        $moved_segment finally determines which segment should be shifted by
        $move_offset pixels from the middle of the pie.
        
    setLegendTextGap($gap)
        Expects an integer and controls the gap between two lines of the legend.

    PieChart

    Constructor:
    PieChart($general_spec, $chart_spec)
        The first parameter should be a ChartSpecification Object, the second
        one a PieChartSpecification Object. By providing these two Objects
        the constructed PieChart Object has all neccessary informations on how
        the piechart should look like.
        
    Functions intended for public use:
    draw()
        Calling this function finally causes the object to generate the desired
        chart.


    PointChartSpecification

    Constructor:
    PointChartSpecification()
        Constructs a new PointChartSpecification object. Expects no parameters.
        
    Functions intended for public use:
    setPointsize($pointsize)
        Expects a positive integer value to set the pointsize.

    setBackgroundcolors($bg1, $bg2)
        Expects two Color Objects. The background of the chart will be
        alternating between those two colors.
        
    setGrid($grid_h_type, $grid_v_type, $h_color, $v_color)
        Expects two integers and two Color objects.
        $grid_h_type nad $grid_v_type should be 0 to be invisible or 2 to be
        solid lines. Some implementations can handle dashed lines which can be
        activated by using value 1.
        Example:
        $myBCS->setGrid(0, 2, new Color(0, 0, 0), new Color(255, 255, 255));
        Will generate only white vertical lines.
        
    setAxis($min, $max, $steps, $axiscolor, $x_desc, $y_desc)
        Expects 3 numeric values a Color object and two strings.
        $min and $max will be the minimum and maximum values of the y-axis.
        Be aware: They only take effect if autoscale is false!
        Steps will determine how many horizontal lines will be drawn.
        The Color will affect the appearance of the axis and the barborder.
        If you provide descriptionstrings for x- and y-Dimensions, they will be
        drawn on the corresponding axis.
        
    setAutoscale($autoscale, $mul_val, $add_val)
        Expects a boolean and two numeric values.
        If autoscale is true the internal autoscale mechanism will be enabled.
        Min and max values set by the function setAxis() will be ignored.
        Instead the min/max value of the axis will be determined by
        getMin/MaxValue() * $mul_val -/+ $add_val.
        For Example:
        If the ChartSpecification contains datatriples with values ranging from
        -10 to 90 calling setAutoscale(true, 1.0, 0.0) will scale the axis
        exactly from -10 to 90. Most of the times you use this function you
        will want to have maybe about 10% space, so you could call
        setAutoscale(true, 1.1, 0.0). Or maybe you have a dataset with values
        from -3 to 3. Calling setAutoscale(true, 1.0, 2.0) will result in an
        axis ranging from -5 to 5 (-3*1.0-2 to 3*1.0+2.0).
        Hint: If you want to take full control over the axis, you shouldn't call
        setAutoscale at all, but rather take care o the min and max values you
        inserted into the specification an set the proper values by yourself
        using the setAxis() function.

    setValuesVisible($showvalues)
        Expects a boolean. If set to true, the values will be printed above
        the points.

    PointChart

    Constructor:
    PointChart($general_spec, $chart_spec)
        The first parameter should be a ChartSpecification Object, the second
        one a PointChartSpecification Object. By providing these two Objects
        the constructed PointChart Object has all neccessary informations on how
        the pointchart should look like.
        
    Functions intended for public use:
    draw()
        Calling this function finally causes the object to generate the desired
        chart.


    LineChartSpecification

    Constructor:
    LineChartSpecification()
        Constructs a new LineChartSpecification object. Expects no parameters.
        
    Functions intended for public use:
    setLineThickness($linethickness)
        Expects a positive integer value to set the thickness of the line.

    setBackgroundcolors($bg1, $bg2)
        Expects two Color Objects. The background of the chart will be
        alternating between those two colors.
        
    setGrid($grid_h_type, $grid_v_type, $h_color, $v_color)
        Expects two integers and two Color objects.
        $grid_h_type nad $grid_v_type should be 0 to be invisible or 2 to be
        solid lines. Some implementations can handle dashed lines which can be
        activated by using value 1.
        Example:
        $myBCS->setGrid(0, 2, new Color(0, 0, 0), new Color(255, 255, 255));
        Will generate only white vertical lines.
        
    setAxis($min, $max, $steps, $axiscolor, $x_desc, $y_desc)
        Expects 3 numeric values a Color object and two strings.
        $min and $max will be the minimum and maximum values of the y-axis.
        Be aware: They only take effect if autoscale is false!
        Steps will determine how many horizontal lines will be drawn.
        The Color will affect the appearance of the axis and the barborder.
        If you provide descriptionstrings for x- and y-Dimensions, they will be
        drawn on the corresponding axis.
        
    setAutoscale($autoscale, $mul_val, $add_val)
        Expects a boolean and two numeric values.
        If autoscale is true the internal autoscale mechanism will be enabled.
        Min and max values set by the function setAxis() will be ignored.
        Instead the min/max value of the axis will be determined by
        getMin/MaxValue() * $mul_val -/+ $add_val.
        For Example:
        If the ChartSpecification contains datatriples with values ranging from
        -10 to 90 calling setAutoscale(true, 1.0, 0.0) will scale the axis
        exactly from -10 to 90. Most of the times you use this function you
        will want to have maybe about 10% space, so you could call
        setAutoscale(true, 1.1, 0.0). Or maybe you have a dataset with values
        from -3 to 3. Calling setAutoscale(true, 1.0, 2.0) will result in an
        axis ranging from -5 to 5 (-3*1.0-2 to 3*1.0+2.0).
        Hint: If you want to take full control over the axis, you shouldn't call
        setAutoscale at all, but rather take care o the min and max values you
        inserted into the specification an set the proper values by yourself
        using the setAxis() function.

    setValuesVisible($showvalues)
        Expects a boolean. If set to true, the values will be printed above
        the lines.

    LineChart

    Constructor:
    LineChart($general_spec, $chart_spec)
        The first parameter should be a ChartSpecification Object, the second
        one a LineChartSpecification Object. By providing these two Objects
        the constructed LineChart Object has all neccessary informations on how
        the linechart should look like.
        
    Functions intended for public use:
    draw()
        Calling this function finally causes the object to generate the desired
        chart.