Download the PHP package gremo/highcharts-bundle without Composer

On this page you can find all versions of the php package gremo/highcharts-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package highcharts-bundle

GremoHighchartsBundle

Build status GitHub issues Latest stable Downloads total

Symfony2 Bundle for creating Highcharts charts, fluently and with as little as possible of JavaScript.

Installation

Add the following to your deps file (for Symfony 2.0.*):

Then register the namespaces with the autoloader (app/autoload.php):

Or, if you are using Composer and Symfony 2.1.*, add to composer.json file:

Finally register the bundle with your kernel in app/appKernel.php:

Configuration

See Options providers.

Defining charts

First get gremo_highcharts service from the service container:

Creating charts objects

There is one method for each chart type in gremo_highcharts service:

Last three chart types requires highcharts-more.js. For "special" charts (like combining more than one chart) you can use the generic newChart() method.

Setting and getting properties

Magic methods setXxx (set simple property), newXxx (create nested property), getXxx (get property) are available for charts, axes, series and complex points. String part Xxx will be lcfirst-ed to xxx before setting the property.

Setters setXxx are fluent and returns the instance, while newXxx methods return the nested property itself. Use getParent() to get the parent object:

Will result in:

Refer to to Highcharts API Reference and to Highcharts Demo Page to control the behaviour of your chart.

Creating axes, series and points

The chart object has newXAxis(), newYAxis() and newSeries() methods for creating and adding axes and series to the chart. These methods return nested properties themselves, and work exactly the same way:

For actually addding your data to the chart, you can use newValue($value), newPoint($x, $y) and newComplexPoint():

Alternatively you can set the data directly using setData(array $data) method.

Methods newValue($value), newPoint($x, $y) and setData(array $data) returns the series while newComplexPoint() returns the point itself, for chaining subsequent calls. Values, points and complex points are explained here.

Options providers

Properties defined using options providers applies for all charts. Define a service, add gremo_highcharts.options_provider tag and implement Gremo\HighchartsBundle\Provider\OptionsProviderInterface interface, returing the default options as an array in getOptions() method:

Failing in returing an array type will throw an exception.

Providers with an higher priority will (nicely and recursively) override options from providers with a lower one. See Rendering Charts for actually using default options. Priority attribute is not mandatory.

Built-in options providers

For setting common options, this bundle provides some built-in options providers. If you are fine with default options you can use the short form (works for every provider):

credit_disabler: sets Highcharts credits to off.

lang: provides translation for lang strings using Symfony 2 translation system.

Key reference along with default values:

locale: provides decimal and thousands separators based on the current locale, using PHP intl extension.

Rendering charts

First, pass the chart to your template:

Then in your AcmeHelloBundle:Hello:chart.html.twig template import jQuery along with Highcharts JavaScript file:

Note that jQuery library is only needed for creating the chart after the DOM is ready.

Finally initialize the chart:

You can omit Highcharts.setOptions() if you didn't used any options provider.

Limitations

Since JavaScript closures cannot be serialized, it's not possible to define properties as callbacks directly using this library (e.g. when you need to customize tooltips formatters).

This has to be done directly in JavaScript:

Planned features


All versions of highcharts-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
symfony/dependency-injection Version >=2.0.0,<2.4-dev
symfony/http-kernel Version >=2.0.0,<2.4-dev
symfony/config Version >=2.0.0,<2.4-dev
symfony/translation Version >=2.0.0,<2.4-dev
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gremo/highcharts-bundle contains the following files

Loading the files please wait ....