Download the PHP package ghunti/highcharts-php without Composer

On this page you can find all versions of the php package ghunti/highcharts-php. 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-php

HighchartsPHP

HighchartsPHP is a PHP library that works as a wrapper for the Highchart js library (http://www.highcharts.com) and it was built with flexibility and maintainability in mind. It isn't a simple port of the JavaScript library to PHP, it was designed in a way that mimics the JavaScript counterpart API, so that the developer only needs to learn one API.

The companion webpage can be found at https://goncaloqueiros.net/highcharts.php

Setup

The recommended way to install HighchartsPHP is through Composer. Just create a composer.json file and run the php composer.phar install command to install it:

Current package version supports PHP >= 8.0. For compatibility with older PHP versions, use the 3.x tag.

Usage

Simple

You can create a highchart or highstock chart using one of the three js engine available (jQuery, mootools, and prototype), using the Highchart constructor.

Now that there's a valid $chart object the developer only needs to add elements to it as if it was writing them in JavaScript.

You can also create simple arrays

Render

To get all the script necessary to render your chart you can use the printScripts() method:

Or if you don't want to directly echo the scripts and rather the function to return the script string:

And finally to render the chart object use the render() method:

The first (optional) argument passed to render method is the var name to be used by JavaScript and the second (optional) argument is the callback to be passed to the Highcharts.Chart method. The third and last (optional) argument flags that you want your script already wrapped around HTML script tags.

Its also possible to render the chart options only by calling the method. Useful for times where the chart is used inside a call for example

Javascript expressions

If one of the chart options must be a JavaScript expression, you can't assign a simple string to it, otherwise it will be printed as a simple JavaScript string also. For that you must use the special HighchartJsExpr object:

Empty javascript object {}

If you wish to render an empty javascript object , just assign the variable you want with

Extra scripts

To manually include a script for render use the function:

To include an extra script use the key that's on the config file or that was given manually via

To include more than one script just add it to the array

If no arguments are passed, it will include all the extra scripts

If you want to add any extra script to the default config file, feel free to open a PR. Here is the list of the current extra scripts available:

Use new Highcharts 3.0 charts

Highcharts 3.0 introduced a new set of charts that require an additional javascript file .

To include this extra script you need to call the method with the highcharts-more key.

Render only some options

If you need to render a small portion of options, you can use the method.

A good example of this can be found at clock demo

This way it is possible to include option rendering inside a javascript expression

Set up a general configuration

There are cases where a configuration is not created only for a chart, but for all the charts on the page (lang and global) are examples of this.

To set a general option, just create a new (not chart) and send it to method.

The must be placed before the chart render

Themes

Theme creation follows the same process for a general option. You create a new object, use it has if it was a chart and then call method.

Configuration

By default HighchartsPHP library comes with configurations to work out of the box. If you wish to change the path of any js library loaded, have a look at src/config.php. In case you need to change some of this values you should use the setConfigurations method:

Demos

All the Highcharts and Highstocks live demos present on http://www.highcharts.com under the demo gallery were reproduced using this library and you can find them on the demos folder or see a live example on https://goncaloqueiros.net/highcharts/demos.php

Tests

You can run the unit tests with the following command:

License

The HighchartsPHP package is open-sourced software licensed under the MIT license.


All versions of highcharts-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
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 ghunti/highcharts-php contains the following files

Loading the files please wait ....