Download the PHP package namelesscoder/numerolog-lavacharts without Composer
On this page you can find all versions of the php package namelesscoder/numerolog-lavacharts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download namelesscoder/numerolog-lavacharts
More information about namelesscoder/numerolog-lavacharts
Files in namelesscoder/numerolog-lavacharts
Package numerolog-lavacharts
Short Description Chart renderer for Numerolog data sources
License
Informations about the package numerolog-lavacharts
Numero-log: Lavacharts
Thin client to access Numerolog counters and render then as graphs using the Lavacharts library (https://github.com/kevinkhill/lavacharts) which in turn uses Google's powerful Charts package (https://developers.google.com/chart/interactive/docs). The client pulls values from a Numerolog package using a token, then renders the data sets as a nice chart. All graph types and options of Google Charts are supported.
Being Javascript based, this charting package is obviously limited to browser-based use.
Installation
Use composer:
Usage
Then either integrate from anywhere by calling methods manually with an array as input:
Alternatively, do the same but configure the ChartQuery manually:
The output will include both the <div>
that will contain the graph as well as every
dependency required by Google Charts to render the graph. Graph data is converted to a
JavaScript array that is embedded in the HTML.
Integration
To render the graphs anywhere other than on the host that generates the chart - which you may for example want to do if you are using the public Numerolog end-point - simply load the response body of the HTTP request and output it in your own HTML document. The example below is the extremely basic implementation of that principle:
Since the default output already contains both <script>
tag and <div>
there's nothing
more you need to do before the chart is displayed. Change the URL parameters to affect
how the chart itself is rendered - see below!
Public implementation
A publicly available graph rendering is available from:
It accepts plain old GET
parameters:
And native parameters for basic chart configuration:
And the special chartAttributes
(which correspond to Google Chart configurations):
And they all must be specified together. Required arguments are:
package
counter
token
action
(onlyget
is supported)
Plus the following references for other arguments:
Note that the Google Chart options you can use will always depend on the type of chart you are rendering.