Giter VIP home page Giter VIP logo

highcharts-php's Introduction

Highcharts PHP Project Build Status

What is Highcharts PHP

Highcharts PHP is a PHP library to interact with the Highcharts JS charting library. Thanks to Roberto Aloi for making the first highcharts-php library.

What is Highcharts

Reading from the official documentation, "Highcharts is a charting library written in pure JavaScript, offering an easy way of adding interactive charts to your web site or web application".

Developers

History

Version 1.1

  • PSR-0 code compliance
  • Adding composer for externals
  • Some more tests

Version 1.0.1

  • Bug fixes

Version 1.0

  • Multipurpose class abstraction of Highcharts
  • The very first test to ensure continuous integration based development

Installation

The Highcharts JS libraries are available at: www.highcharts.com and they are free for non commercial use. For commercial usage, please refers to the license and pricing section of their website. Download the Highchart JS library along with jQuery.

Example

Here is an example implementation:

    <!-- jQuery and Highchart JS -->
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script src="http://www.highcharts.com/js/highcharts.js" type="text/javascript"></script>

    <?php

	// Load composer autoloader
    require_once('../../vendor/autoload.php');

    // Start by adding a new reference object
    // and adding some configuration for the chart
    $oHighcharts = new Highchart\Highchart(new Highchart\Chart('container', Highchart\Chart::SERIES_TYPE_COLUMN));

	// Title typeof HighchartsTitle
	$oHighcharts->title = new Highchart\Title('Stacked bar chart');

    // Description of xAxis
    $oHighcharts->xAxis->categories = array('Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas');

    // Options for yAxis
    $oHighcharts->yAxis->min = 0;
    $oHighcharts->yAxis->setTitle(new Highchart\Title('Total fruit consumption'));

    $oHighcharts->legend->reversed = true;

    // The formatter is a javascript callback
    $oHighcharts->tooltip->setFormatter("function() {
        return this.series.name +': '+ this.y +'';
    }");

    // If stacking, choose normal
    $oHighcharts->plotOptions->column->stacking = Highchart\Plot\Options\Column::HIGHCHARTS_PLOT_OPTIONS_COLUMN_STACKING_NORMAL;

    // These are your data
    $oHighcharts->series->addSerie(new Highchart\Serie(array(5, 3, 4, 7, 2), 'John'));
    $oHighcharts->series->addSerie(new Highchart\Serie(array(2, 2, 3, 2, 1), 'Jane'));
    $oHighcharts->series->addSerie(new Highchart\Serie(array(3, 4, 4, 2, 5), 'Joe'));


    // Render chart
    echo $oHighcharts->render();

    // Enjoy your new chart
    echo '<div id="container" style="width: 340px; height: 240px;"> </div>';

highcharts-php's People

Contributors

blomman9 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.