Skip to content
hanzo2001 edited this page May 17, 2016 · 9 revisions

Welcome to the wiki for documenting the ChartExtension options and extensible features.

The ChartExtension is a simple wrapper on top of the Google Visualization API (docs) to facilitate the generation of charts in one step. The extension lives and depends on jQuery, and, as such, it is easily initialized as so:

$('#<id>').CreateChart(optionsObject);

Limitation: the selector has to target a single element that has an id attribute. The element targeted does not have to be a <div> but, for simplicity's sake, it's recommended.

It is safe to run this code inside a jQuery onLoad handler:

$(function(){
    $('#<id>').CreateChart({
        // options
    });
})

This wiki will attempt to document all the available options as well as the few features that exist on top of the original API. As a bonus, certain features can be added to the extension and configured through the options as well.

An example of usage:

$('#dashboard').CreateChart({
	// what to display
	chartType : 'ComboChart',
	// backend contact details
	url : 'http://localhost/modularizedcharts/ajax.php',
	params : {
		action: 'hiredPersonnelByMonth'
	},
	// any options allowed from the Google API
	chartOptions : {
		height : 300,
		legend : {
			position : 'bottom',
			alignment : 'top'
		}
	},
	// specific feature
	rangeStack : true
})