Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xchwarze/yii2-chart-widget

Chart implementation of chartist for yii2 framework
https://github.com/xchwarze/yii2-chart-widget

chart charts yii2 yii2-extension

Last synced: 3 days ago
JSON representation

Chart implementation of chartist for yii2 framework

Awesome Lists containing this project

README

        

# yii2-widget-chart
Wrapper for [CHARTIST.JS](http://gionkunz.github.io/chartist-js/index.html) library

## Resources
* [yii2](https://github.com/yiisoft/yii2) framework
* [gionkunz/chartist-js](https://github.com/gionkunz/chartist-js)

## Installation

The preferred way to install this extension is through [composer](http://getcomposer.org/download/)

Either run

```sh
$ php composer.phar require --prefer-dist "exocet/yii2-chart-widget"
```
or add

```json
{
"require": {
"exocet/yii2-chart-widget": "~1.0"
}
}
```

to the `require` section of your `composer.json`

## Example Usage

```php
title = 'my example';
$this->params['breadcrumbs'][] = $this->title;

?>
Chart::TYPE_LINE,
'disableCss' => true, //disable chartist css
'label' => true, //enable labels plugin
'labels' => [1, 2, 3, 4],
'series' => [[100, 120, 180, 200]],
'clientOptions' => [
'showLine' => false,
'axisX' => [
'labelInterpolationFnc' => new JsExpression('function(value, index) {
return index % 13 === 0 ? \'W\' + value : null;
}')
]
],
'responsiveOptions' => [
'screen and (min-width: 640px)' => [
'axisX' => [
'labelInterpolationFnc' => new JsExpression('function(value, index) {
return index % 4 === 0 ? \'W\' + value : null;
}')
]
]
]
]);
?>
```

## Ajax Example Usage

```php
title = 'my example';
$this->params['breadcrumbs'][] = $this->title;

?>
Chart::TYPE_LINE,
'ajax' => Url::to(['ajax-data']),
]);
?>
```

## License
**yii2-chart-widget** is released under MIT license. See bundled [LICENSE](LICENSE) for details