PHPackages                             sibilino/dygraphswidget - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sibilino/dygraphswidget

ActiveLibrary

sibilino/dygraphswidget
=======================

Graphing and charting widget for Yii 1, based on Dygraphs.js

v1.1.0(11y ago)0201MITPHPPHP &gt;=5.3.0

Since Feb 13Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Sibilino/yii-dygraphswidget)[ Packagist](https://packagist.org/packages/sibilino/dygraphswidget)[ Docs](https://github.com/Sibilino/yii-dygraphswidget)[ RSS](/packages/sibilino-dygraphswidget/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)DependenciesVersions (4)Used By (0)

Dygraphs Widget for Yii
=======================

[](#dygraphs-widget-for-yii)

---

A simple graph widget for Yii 1, based on \[Dygraphs\] ().

Changelog
---------

[](#changelog)

---

1.1.0 - Added visibility checkboxes feature.

Installation
------------

[](#installation)

---

Download the latest release and unpack the **contents** of the `widget` folder inside the `protected\extensions\dygraphswidget` folder within your Yii application.

Usage
-----

[](#usage)

---

In your view, create the widget with your data matrix as its *data* option.

```
$this->widget('ext.dygraphswidget.DygraphsWidget', array(
		'data'=> $your_data,
	));
```

Dygraphs options
----------------

[](#dygraphs-options)

---

You can set the *options* property to pass additional options to the Dygraphs object:

```
$this->widget('DygraphsWidget', array(
		'data'=> $your_data,
		'options'=>array(
			'labels' => array('X', 'Sin', 'Rand', 'Pow'),
			'title'=> 'Main Graph',
			//...
		),
	));
```

Data formats
------------

[](#data-formats)

---

The data property can be specified in three different formats. Consider the following examples, and make sure to read \[the official documentation\] () for more details:

- **Matrix**

```
$data = array(
	array(1, 25, 100),
	array(2, 50, 90),
	array(3, 100, 80),
	//...
);
```

- **URL**An absolute URL to a text file with the data.

```
$data = 'http://dygraphs.com/dow.txt';
```

- **Function**A string with JS code that returns a data object usable by Dygraphs.

```
$data = 'function () {
	var data = [];
      for (var i = 0; i < 1000; i++) {
        var base = 10 * Math.sin(i / 90.0);
        data.push([i, base, base + Math.sin(i / 2.0)]);
      }
      var highlight_start = 450;
      var highlight_end = 500;
      for (var i = highlight_start; i  'js:function(canvas, area, g)
			{
				var bottom_left = g.toDomCoords(highlight_start, -20);
				var top_right = g.toDomCoords(highlight_end, +20);

				var left = bottom_left[0];
				var right = top_right[0];

				canvas.fillStyle = "rgba(255, 255, 102, 1.0)";
				canvas.fillRect(left, area.y, right - left, area.h);
            }'
);
```

Alternatively, you can pass a new instance of CJavaScriptExpression() constructed with your JavaScript string.

Visibility checkboxes
---------------------

[](#visibility-checkboxes)

---

It is often useful to hide and show some of the dataseries in a chart. The widget features helper scripts to easily control series visibily with checkboxes.

To use this feature, make sure your page has one checkbox per series in the chart, and give each checkbox an `id` attribute with the index of the series controlled by it. Then, configure the widget with a `checkBoxSelector` that matches the group of checkboxes. For example, for a chart with 3 data series:

```

```

```
$this->widget('DygraphsWidget', array(
		'data'=> array(
			// (x, series0, series1, series2)
			array(0, 3, 25, 247),
			array(1, 6, 26, 127),
			array(2, 9, 27, -7),
			//...
		),
		'checkBoxSelector' => 'input.visibility',
		//...
	),
));
```

The attribute that associates a checkbox with a data series (`id` in the example) can be changed by configuring `checkBoxReferenceAttr`.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~14 days

Total

3

Last Release

4074d ago

Major Versions

v0.3.0 → v1.0.02015-02-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/09faa0262d1a65aa0b933cd977db6e90364262009c3122f22a3638ac78f7ebc1?d=identicon)[Sibilino](/maintainers/Sibilino)

---

Top Contributors

[![Sibilino](https://avatars.githubusercontent.com/u/3646583?v=4)](https://github.com/Sibilino "Sibilino (35 commits)")

---

Tags

widgetyiichartgraphdygraphs

### Embed Badge

![Health badge](/badges/sibilino-dygraphswidget/health.svg)

```
[![Health](https://phpackages.com/badges/sibilino-dygraphswidget/health.svg)](https://phpackages.com/packages/sibilino-dygraphswidget)
```

###  Alternatives

[novus/nvd3

A reusable charting library written in d3.js

7.2k207.7k2](/packages/novus-nvd3)[vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

243979.7k40](/packages/vova07-yii2-imperavi-widget)[amenadiel/jpgraph

Composer Friendly, full refactor of JpGraph, library to make graphs and charts

1492.2M7](/packages/amenadiel-jpgraph)[cmen/google-charts-bundle

This Bundle provides a Twig extension and PHP objects to display Google charts in your Symfony application.

76844.8k2](/packages/cmen-google-charts-bundle)[sjaakp/yii2-sortable-behavior

Sort ActiveRecords and related records in Yii2.

36144.7k](/packages/sjaakp-yii2-sortable-behavior)[evgeniyrru/yii2-slick

Yii2 extension for Slick Carousel

22182.1k3](/packages/evgeniyrru-yii2-slick)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
