Beispiel #1
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
//require_once ABSPATH."php/jqGridPdo.php";
require_once ABSPATH . "php/jqChart.php";
ini_set("display_errors", "1");
$tooltip = <<<TOOL
function()
{
\tvar s;
\tif (this.point.name) { // the pie chart
\t\ts = ''+ this.point.name +': '+ this.y +' fruits';
\t} else {
\t\ts = ''+ this.x  +': '+ this.y;
\t}
\treturn s;
}
TOOL;
$chart = new jqChart();
$chart->setTitle(array('text' => 'Combination chart'))->setxAxis(array("categories" => array('Apples', 'Oranges', 'Pears', 'Bananas', 'Plums')))->setTooltip(array("formatter" => $tooltip))->setLabels(array("items" => array(array("html" => 'Total fruit consumption', "style" => array("left" => "40px", "top" => "8px", "color" => "black")))))->addSeries('Jane', array(3, 2, 1, 3, 4))->setSeriesOption('Jane', 'type', 'column')->addSeries('John', array(2, 3, 5, 7, 6))->setSeriesOption('John', 'type', 'column')->addSeries('Joe', array(4, 3, 3, 9, 0))->setSeriesOption('Joe', 'type', 'column')->addSeries('Total consumption', array(array("name" => "Jane", "y" => 13, 'color' => '#4572A7'), array("name" => "John", "y" => 23, 'color' => '#AA4643'), array("name" => "Joe", "y" => 19, 'color' => '#89A54E')))->setSeriesOption('Total consumption', array("type" => "pie", "center" => array(100, 80), "size" => 100, "showInLegend" => false, "dataLabels" => array("enabled" => false)))->addSeries('Average', array(3, 2.67, 3, 6.33, 3.33))->setSeriesOption('Average', 'type', 'spline');
echo $chart->renderChart('', true, 700, 350);
Beispiel #2
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
ini_set("display_errors", "1");
$chart = new jqChart();
$chart->setTitle(array('text' => 'Scatter plot with regression line'))->setxAxis(array("min" => -0.5, "max" => 5.5))->setyAxis(array("min" => 0))->addSeries('Regression Line', array(array(0, 1.11), array(5, 4.51)))->setSeriesOption('Regression Line', array('type' => 'line', 'marker' => array("enabled" => false), 'states' => array("hover" => array("lineWidth" => 1)), 'enableMouseTracking' => false))->addSeries('Observations', array(1, 1.5, 2.8, 3.5, 3.9, 4.2))->setSeriesOption('Observations', array('type' => 'scatter', 'marker' => array("radius" => 4)));
echo $chart->renderChart('', true, 700, 350);
Beispiel #3
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
ini_set("display_errors", "1");
$chart = new jqChart();
$chart->setTitle(array('text' => 'Browser market shares at a specific website, 2010'))->setTooltip(array("formatter" => "function(){return '<b>'+ this.point.name +'</b>: '+ this.y +' %';}"))->setPlotOptions(array("pie" => array("allowPointSelect" => true, "cursor" => 'pointer', "dataLabels" => array("enabled" => true, "color" => '#000000', "connectorColor" => '#000000', "formatter" => "js:function(){return '<b>'+ this.point.name +'</b>: '+ this.y +' %'}"))))->addSeries('Browser share', array(array('Firefox', 45.0), array('IE', 26.8), array("name" => 'Chrome', "y" => 12.8, "sliced" => true, "selected" => true), array('Safari', 8.5), array('Opera', 6.2), array('Others', 0.7)))->setSeriesOption('Browser share', 'type', 'pie');
echo $chart->renderChart('', true, 700, 350);