My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Usage  
Updated Jun 13, 2010 by kbradwick@gmail.com

Installation

Download the extension using SVN or by direct download and place in the extensions folder (protected/extensions).

Usage

Use the widget in your view files like any other widget. For example,

<?php

$this->widget('application.extensions.cvisualizewidget.CVisualizeWidget',array(
	'data'=>array(
		'headings'=>array(
			'January',
			'February',
			'March',
			'April',
			'May',
			'June',
			'July',
			'August',
			'September',
			'October',
			'November',
			'December'
		),
		'data'=>array(
			'Hits' => array(4,8,25,56,23,78),
			'Visits' => array(2,6,3,14,56,78),
			'Downloads'=>array(12,4,15,99,4,99)
		)
	),
	'options' => array(
		'title'=>'Sample Data',
		'width'=>950,
		'height'=>250
	)
));


?>

Example Charts

You can view examples of the types of charts available by visiting http://dwpe.googlecode.com/svn/trunk/charting/index.html.

Options

The options available to you within the widget are as follows;

tableID - The table used (default: visualize)

type - The type of chart. Pick from bar, linr, area, pie (default: area)

cssFile - Specify your own css file to be included for the chart

defaultSkin - If no css file is specified, the included styles will be applied. Choose from light or dark (default: light)

options - An array of options relating to the jQuery plugin. Defaults are;

array(
	'width'=>400,
	'height'=>400,
	'title'=>'Statistics',
	'title'=>'',
	'colors'=>array('#be1e2d','#666699','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744'),
	'textColors'=>array('#004c93'),
	'parseDirection'=>'x',
	'pieMargin'=>20,
	'pieLabelPos'=>'inside',
	'lineWeight'=>4,
	'barGroupMargin'=>10,
	'barMargin'=>1
);

data - This is where you specify the data to be rendered. The variable is an array and should consist of two further arrays. The first being 'headings' and the second is 'data' (see example above on how to use)


Sign in to add a comment
Powered by Google Project Hosting