code-works/yii-c3js

c2.js adapter for the Yii Framework

Installs: 13

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Language:JavaScript

v1.0.0 2016-06-26 16:32 UTC

This package is not auto-updated.

Last update: 2024-09-28 19:58:10 UTC


README

Latest Stable Version Total Downloads License Scrutinizer Code Quality

Easily add C3.js graphs to your Yii application.

Links

Requirements

  • Yii 1.1.5 or above
  • PHP 5.1 or above

Installation

  • Extract the release file under protected/extensions/

Usage

To use this widget, you may insert the following code into a view file:

$this->Widget('ext.c3js.C3JsWidget', array(
    'options' => array(
        'title' => array(
            'text' => "My Chart"
        ),
        'data' => array(
            'columns' => array(
                array('data1', 30, 200, 100, 400, 150, 250)
            ),
        )
    )
));
?>

By configuring the options property, you may specify the options that need to be passed to the C3.js JavaScript object. Please refer to the demo gallery and documentation on the C3.js website for possible options.

Alternatively, you can use a valid JSON string in place of an associative array to specify options


*Note:* You must provide a *valid* JSON string (double quotes) when using the second option. 
You can quickly validate your JSON string online using [JSONLint](http://jsonlint.com/).