highcharts Highcharts, Highstock and Highmaps Widgets

  1. About
  2. Links
  3. Requirements
  4. Installation
  5. Usage
  6. Tips
  7. Change Log

Easily add Highcharts, Highstock and Highmaps graphs to your Yii application.

Screen Shot

About

Highcharts

Create interactive charts easily for your web projects. Used by tens of thousands of developers and 59 out of the world's 100 largest companies, Highcharts is the simplest yet most flexible charting API on the market.

Highstock

Highstock lets you create stock or general timeline charts in pure JavaScript. Including sophisticated navigation options like a small navigator series, preset date ranges, date picker, scrolling and panning.

Highmaps

Build interactive maps to display sales, election results or any other information linked to geography. Perfect for standalone use or in dashboards in combination with Highcharts!

Links

Note: Highcharts is free for non-commercial use only. For more information, please visit the Highcharts License and Pricing page.

Requirements

  • Yii 1.0 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 in a view:

$this->Widget('ext.highcharts.HighchartsWidget', array(
   'options' => array(
      'title' => array('text' => 'Fruit Consumption'),
      'xAxis' => array(
         'categories' => array('Apples', 'Bananas', 'Oranges')
      ),
      'yAxis' => array(
         'title' => array('text' => 'Fruit eaten')
      ),
      'series' => array(
         array('name' => 'Jane', 'data' => array(1, 0, 4)),
         array('name' => 'John', 'data' => array(5, 7, 3))
      )
   )
));

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

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

$this->Widget('ext.highcharts.HighchartsWidget', array(
   'options' => '{
      "title": { "text": "Fruit Consumption" },
      "xAxis": {
         "categories": ["Apples", "Bananas", "Oranges"]
      },
      "yAxis": {
         "title": { "text": "Fruit eaten" }
      },
      "series": [
         { "name": "Jane", "data": [1, 0, 4] },
         { "name": "John", "data": [5, 7,3] }
      ]
   }'
));

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.

See /doc/examples for more usage examples.

Tips

  • If you need to use JavaScript in any of your configuration options, use the js: prefix. For instance:

    [php]
    ...
    'tooltip' => array(
         'formatter' => 'js:function(){ return this.series.name; }'
    ),
    ...
    
  • Highcharts by default displays a small credits label in the lower right corner of the chart. This can be removed using the following top-level option.

    [php]
    ...
    'credits' => array('enabled' => false),
    ...
    
  • Since version 3.0.2, all adapters, modules, themes, and supplementary chart types must be enabled through the top-level 'scripts' option.

    [php]
    ...
    'scripts' => array(
         'highcharts-more',   // enables supplementary chart types (gauge, arearange, columnrange, etc.)
         'modules/exporting', // adds Exporting button/menu to chart
         'themes/grid'        // applies global 'grid' theme to all charts
    ),
    ...
    

    Previous versions relied on auto-detection magic, but that became less reliable as Highcharts evolved. The new method more accurately follows the native process of including/excluding additional script files and gives the user some finer-grain control. For a list of available scripts, see the contents of protected/extensions/highcharts/assets/.

  • You can access the JavaScript chart object from another script like this:

    [javascript]
    var chart = $('#my-chart-id').highcharts();
    

    where my-chart-id is set via the top-level id configuration option. Just make sure you register your script after the widget declaration so that it has a chance to initialize.

Change Log

v5.0.2 (2016-11-16)
  • Upgraded Highcharts JS library to the latest release (5.0.2). See the Highcharts changelog for more information about what's new in this version.
v5.0.0 (2016-10-03)
  • Upgraded Highcharts JS library to the latest release (5.0.0).
v4.2.6 (2016-08-07)
  • Upgraded Highcharts JS library to the latest release (4.2.6).
v4.2.5 (2016-05-27)
  • Upgraded Highcharts JS library to the latest release (4.2.5).
v4.2.3 (2016-02-11)
  • Upgraded Highcharts JS library to the latest release (4.2.3).
v4.2.2 (2016-02-04)
  • Upgraded Highcharts JS library to the latest release (4.2.2).
v4.2.1 (2016-01-13)
  • Upgraded Highcharts JS library to the latest release (4.2.1).
v4.1.10 (2015-12-14)
  • Upgraded Highcharts JS library to the latest release (4.1.10).
v4.1.9 (2015-10-12)
  • Upgraded Highcharts JS library to the latest release (4.1.9).
v4.1.8 (2015-09-24)
  • Upgraded Highcharts JS library to the latest release (4.1.8).
v4.1.7 (2015-07-09)
  • Upgraded Highcharts JS library to the latest release (4.1.7).
  • Resolved issue #12 by introducing new 'scriptPosition' option.
v4.0.4 (2014-09-19)
  • Upgraded Highcharts JS library to the latest release (4.0.4).
  • Added HighmapsWidget.
  • Added usage examples in /doc/examples.
  • Resolved issue #8: Using Highcharts and Highstock on the same page throws error 16
Previous Releases

Please use the 'Comments' section only for reviews. If you have questions, requests, bug reports or other feedback, use the links above.

88 0
123 followers
31 755 downloads
Yii Version: 1.1
License: MIT
Category: User Interface
Developed by: Milo Schuman
Created on: Oct 7, 2010
Last updated: 7 years ago

Downloads

show all

Related Extensions