d4rkstar/yii2-graphitejs

Yii 2 Graphitejs widget

dev-master 2015-12-14 01:09 UTC

This package is auto-updated.

Last update: 2024-10-12 10:46:33 UTC


README

This widget is a wrapper around GraphiteJS Jquery plugin.

GraphiteJS Plugin allow to easily make graphs and update them on the fly using Graphite's Render Url API.

Installation

The preferred way to install this extension is through composer.

Install

Either run

$ php composer.phar require d4rkstar/yii2-graphitejs "dev-master"

or add

"d4rkstar/yii2-graphitejs": "dev-master"

to the require section of your composer.json file.

Sample Usage

<?php
use d4rkstar\graphitejs\Graphitejs;
?>

... 

<?= Graphitejs::widget([
        'options' => [
            'id'=>'serverLoadGraph',
        ],
        'pluginOptions'=>[
            'url'=>'http://localhost/render/',
            'from'=>'-24hours',
           // replace with your targets
           'target'=>[
               'server.load.load1', 
               'server.load.load5',
               'server.load.load15'
            ],
            'width'=>300,
            'height'=>300,
        ]
]);

?>

For more usage, look at GraphiteJS examples and Graphite's Render Url API.