Download the PHP package rockys/echarts-php without Composer
On this page you can find all versions of the php package rockys/echarts-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rockys/echarts-php
More information about rockys/echarts-php
Files in rockys/echarts-php
Package echarts-php
Short Description A php wrapper for echarts javascript libraries
License MIT
Homepage http://hisune.com
Informations about the package echarts-php
Echarts-PHP
Echarts-PHP is a PHP library that works as a wrapper for the Echarts js library (https://github.com/apache/echarts). Support Apache ECharts (incubating) from version 2.2.x to 5.x.
Welcome star ⭐️!
Setup
The recommended way to install Echarts-PHP is through Composer
. Just run the composer command to install it:
Table of Contents
- Class: ECharts
- __construct([string] $dist = '')
- addSeries(Series $series)
- addXAxis(XAxis $xAxis)
- addYAxis(YAxis $yAxis)
- setOption(array $option)
- getOption([array] $render = null, [boolean] $jsObject = false)
- setJsVar(string $name = null)
- getJsVar()
- render(string $id, [array] $attribute = [], [string] $theme = null)
- on(string $event, string $callback)
- Class: Config
- jsExpr(string $string)
- eventMethod(string $name)
- addExtraScript(string $file, [string] $dist = null)
- $dist
- $distType
- $minify
- $renderScript
- $version
- Theme
- PHPDoc for property
Usage
Simple, recommend using PHP property
public ECharts::__construct([string] $dist = '')
- Param
dist
is your customer dist url.
Add series with property
void ECharts::addSeries(\Hisune\EchartsPHP\Doc\IDE\Series $series)
Add XAxis with property
void ECharts::addXAxis(\Hisune\EchartsPHP\Doc\IDE\XAxis $xAxis)
Add YAxis with property
void ECharts::addYAxis(\Hisune\EchartsPHP\Doc\IDE\YAxis $yAxis)
Or you can set option array directly
void ECharts::setOption(array $option)
- Param
option
is ECharts option array to be set.
array|string ECharts::getOption([array] $render = null, [boolean] $jsObject = false)
- Param
render
is ECharts option array. - Param
jsObject
is whether or not to return json string, return PHP array by default.
Array key support
Empty object assignment
If you need to assign a value to an empty object, you can use StdClass
, for example: $chart->yAxis = new \StdClass;
Javascript function
string Config::jsExpr(string $string)
Customer JS variable name
void ECharts::setJsVar(string $name = null)
- Param
name
is your customer js variable name. By default, js variable name will generate by random.
string ECharts::getJsVar()
Customer attribute
string ECharts::render(string $id, [array] $attribute = [], [string] $theme = null)
- Param
id
is your html dom ID. - Param
attribute
is your html dom attribute. - Param
theme
is your ECharts theme. - Return html string.
Events (for 3.x+)
void ECharts::on(string $event, string $callback)
- Param
event
is event name, available:click
,dblclick
,mousedown
,mousemove
,mouseup
,mouseover
,mouseout
- Param
callback
is event callback.
string Config::eventMethod(string $name)
- Param
name
is your js function name which to be run in event callback. - Return js string, eg: Config::eventMethod('test') => test(params);
Customer dist
Dist type
Whether or not load minify js file
Add extra script from cdn
string Config::addExtraScript(string $file, [string] $dist = null)
- Param
file
is your extra script filename. - Param
dist
is your dist CDN uri.
The example for ECharts theme use addExtraScript
Full Echarts PHPDoc
For more detail visit: https://hisune.com/view/50/echarts-php-property-phpdoc-auto-generate
Demos
https://demo.hisune.com/echarts-php/
demo
All the Echarts live demos present on https://echarts.apache.org/
License
MIT
All versions of echarts-php with dependencies
ext-json Version *