scottharwell / GoogleCharts

CakePHP Plugin for Google Charts Javascript API
26 stars 30 forks source link

Add support for data formatters #13

Closed PhantomWatson closed 10 years ago

PhantomWatson commented 10 years ago

Usage: When defining a column, a NumberFormat pattern can be assigned to the 'format' key.

Example:

$this->chart->columns(array(
    'category' => array(
        'label' => 'Timespan', 
        'type' => 'string'
    ),
    'value' => array(
        'label' => 'Values, 
        'type' => 'number',
        'format' => '0.00%'
    )
);

This format will then be used in tooltips when the user hovers over the corresponding chart element.

Fixes scottharwell#12

scottharwell commented 10 years ago

Thanks for the adding the feature! Looks good!