Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Gabriela Arsene: "MySQL PHP Generator is really excellent! A very useful, easy to use tool and above all it is free, saving a lot of time and money to a developer! Great job! Congratulations to all the people who work at this project".
David Lantz: "Thank you, this is by far the simplest, and most friendly utility for building db record system I have ever used. I wish I could get my systems guys at the office to purchase this for our company would be so very helpful and speed up a lot of work. I for one have used it for everything from a simple inventory record of my house, to a members record for my church just little pet projects and a test bed to test my own db builds and theories before having to hand code at the office..... it is a lot of fun to work with".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

Advanced options

The previous topic learns how to setup common options of a chart. This topic explains how to customize the chart according to your needs. Live Demo.

 

The key idea is that you can setup absolutely all the options that are available in the Google chart library. All you need is to study the reference from Google and write a few lines of PHP code to set property values.

 

The function that is invoked for each chart on the page is defined as follows:

 

Signature:

function OnPrepareChart(Chart $chart)

 

Parameters:

$chart

An instance of the Chart class

getId()

Returns the identifier of the chart (unique among all charts on a page).

setOptions($array)

Sets chart options. Here $array is an associative array that stores all the options you want to apply to the chart.

 

Example 1:

To set the value of the property propName, use the following syntax:

 

$chart->setOptions(array(

       'propName' => 'Value',

 ));

 

To set the value of the property objectName.propName, use the following syntax:

 

$chart->setOptions(array(

       'objectName' =>  array('propName' => 'value'), 

 ));

 

Operating in the same way you can set any property provided by the library.

 

Example 2:

The following code is used in the NBA demo application to customize the chart on the Players page:

 

if ($chart->getId() === 'height-by-avg-age') {

   $chart->setOptions(array(

       'height' => 400,

       'theme' => 'maximized',

       'legend' => array('position' => 'bottom'), 

       'hAxis' => array('format' => '0'),

   ));

}

 

Example 3:

The following code is used in the NBA demo application to customize charts on the Teams->Home games and Teams->Away games pages:

 

$options = array(

    'colors' => array('#9ECC3C', '#CC3C3C'),

    'titleTextStyle' => array('fontSize' => 14),

);

if ($chart->getId() === 'overall-win-loss') {

    $chart->setOptions(array_merge($options, array(

        'chartArea' => array('width' => '70%', 'height' => '70%', 'top' => '18%'),

        'legend' => 'none',

    )));

} else if ($chart->getId() === 'win-loss-by-month') {

    $chart->setOptions(array_merge($options, array(

        'vAxis' => array('format' => '0'),

    )));

}



Prev Return to chapter overview Next