Esempio n. 1
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "column"))->setTitle(array('text' => 'Stacked column chart'))->setxAxis(array("categories" => array('Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas')))->setyAxis(array("min" => 0, "title" => array("text" => "Total fruit consumption")))->setTooltip(array("formatter" => "function(){return this.series.name +': '+ this.y +' ('+ Math.round(this.percentage) +'%)';}"))->setPlotOptions(array("column" => array("stacking" => "percent")))->addSeries('Jhon', array(5, 3, 4, 7, 2))->addSeries('Jane', array(2, 2, 3, 2, 1))->addSeries('Joe', array(3, 4, 4, 2, 5));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 2
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");
$conn = new PDO(DB_DSN, DB_USER, DB_PASSWORD);
// Tell the db that we use utf-8
jqGridDB::query($conn, "SET NAMES utf8");
$chart = new jqChart($conn);
$chart->setChartOptions(array("defaultSeriesType" => "line"))->setTitle(array('text' => 'Freight by Month 1997', "x" => -20))->setyAxis(array("title" => array("text" => "Freight")))->setTooltip(array("formatter" => "function(){return '<b>'+ this.series.name +'</b><br/>'+this.x +': '+ this.y;}"))->addSeries('Blauer See Delikatessen', "SELECT MONTH(OrderDate), SUM(Freight) FROM orders WHERE CustomerID =?  AND OrderDate BETWEEN '1997-01-01' AND '1997-12-31' GROUP BY MONTH(OrderDate)", array('BERGS'))->addSeries('White Clover Markets', "SELECT MONTH(OrderDate), SUM(Freight) FROM orders WHERE CustomerID =?  AND OrderDate BETWEEN '1997-01-01' AND '1997-12-31' GROUP BY MONTH(OrderDate)", array('WHITC'));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 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->setChartOptions(array("defaultSeriesType" => "column"))->setTitle(array('text' => 'Monthly Average Rainfall'))->setSubtitle(array("text" => "Source: WorldClimate.com"))->setxAxis(array("categories" => array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')))->setyAxis(array("min" => 0, "title" => array("text" => "Rainfall (mm)")))->setLegend(array("layout" => "vertical", "backgroundColor" => '#FFFFFF', "align" => "left", "verticalAlign" => 'top', "x" => 100, "y" => 70, "floating" => true, "shadow" => true))->setTooltip(array("formatter" => "function(){return this.x +': '+ this.y +' mm';}"))->setPlotOptions(array("column" => array("pointPadding" => 0.2, "borderWidth" => 0)))->addSeries('Tokyo', array(49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.59999999999999, 54.4))->addSeries('New York', array(83.59999999999999, 78.8, 98.5, 93.40000000000001, 106.0, 84.5, 105.0, 104.3, 91.2, 83.5, 106.6, 92.3))->addSeries('London', array(83.59999999999999, 78.8, 98.5, 93.40000000000001, 106.0, 84.5, 105.0, 104.3, 91.2, 83.5, 106.6, 92.3))->addSeries('Berlin', array(42.4, 33.2, 34.5, 39.7, 52.6, 75.5, 57.4, 60.4, 47.6, 39.1, 46.8, 51.1));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 4
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "area", "inverted" => true))->setTitle(array('text' => 'Average fruit consumption during one week'))->setSubtitle(array("style" => array("position" => 'absolute', "right" => '0px', "bottom" => '10px')))->setLegend(array("layout" => 'vertical', "align" => 'right', "verticalAlign" => 'top', "x" => -100, "y" => 100, "floating" => true, "borderWidth" => 1, "backgroundColor" => '#FFFFFF'))->setxAxis(array("categories" => array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday')))->setyAxis(array("title" => array("text" => 'Number of units'), "labels" => array("formatter" => "js:function(){return this.value;}")))->setTooltip(array("formatter" => "function(){return this.x +': '+ this.y;}"))->setPlotOptions(array("area" => array("fillOpacity" => 0.5)))->addSeries('Jhon', array(3, 4, 3, 5, 4, 10, 12))->addSeries('Jane', array(1, 3, 4, 3, 3, 5, 4));
echo $chart->renderChart('', true, 680, 350);
Esempio n. 5
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");
$chart = new jqChart();
$chart->setChartOptions(array("zoomType" => "xy"))->setTitle(array('text' => 'Average Monthly Temperature and Rainfall in Tokyo'))->setSubtitle(array('text' => 'Source: WorldClimate.com'))->setxAxis(array("categories" => array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')))->setyAxis(array(array("labels" => array("formatter" => "js:function(){return this.value +'C';}", "style" => array("color" => '#89A54E')), "title" => array('text' => 'Temperature', "style" => array("color" => '#89A54E'))), array("title" => array('text' => 'Rainfall', "style" => array("color" => '#4572A7')), "labels" => array("formatter" => "js:function(){return this.value +'mm';}", "style" => array("color" => '#4572A7')), "opposite" => true)))->setTooltip(array("formatter" => "function(){return this.x +': '+ this.y + (this.series.name == 'Rainfall' ? ' mm' : 'C')}"))->setLegend(array("layout" => 'vertical', "align" => 'left', "x" => 120, "y" => 100, "verticalAlign" => 'top', "floating" => true, "backgroundColor" => '#FFFFFF'))->addSeries('Rainfall', array(49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.59999999999999, 54.4))->setSeriesOption('Rainfall', array('type' => 'column', "color" => '#4572A7', "yAxis" => 1))->addSeries('Temperature', array(7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6))->setSeriesOption('Temperature', array('type' => 'spline', "color" => '#89A54E'));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 6
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");
//$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
// Tell the db that we use utf-8
//jqGridDB::query($conn,"SET NAMES utf8");
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "spline"))->setTitle(array('text' => 'Monthly Average Temperature'))->setSubtitle(array("text" => "Source: WorldClimate.com"))->setxAxis(array("categories" => array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')))->setyAxis(array("title" => array("text" => "Temperature"), "labels" => array("formatter" => "js:function() {\n               return this.value + 'C';\n            }")))->setTooltip(array("crosshairs" => true, "shared" => true))->setPlotOptions(array("spline" => array("marker" => array("lineColor" => "#666666", "radius" => 4, "lineWidth" => 1))))->addSeries('Tokyo', array(7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, array("y" => 26.5, "marker" => array("symbol" => 'url(sun.png)')), 23.3, 18.3, 13.9, 9.6))->setSeriesOption('Tokyo', array("marker" => array("symbol" => 'square')))->addSeries('London', array(array("y" => 3.9, "marker" => array("symbol" => 'url(snow.png)')), 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8))->setSeriesOption('London', array("marker" => array("symbol" => 'diamond')));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 7
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "area"))->setTitle(array('text' => 'Historic and Estimated Worldwide Population Growth by Region'))->setSubtitle(array("text" => 'Source: Wikipedia.org'))->setxAxis(array("categories" => array('1750', '1800', '1850', '1900', '1950', '1999', '2050'), "tickmarkPlacement" => 'on', "title" => array("enabled" => false)))->setyAxis(array("title" => array("text" => 'Percent')))->setTooltip(array("formatter" => "function(){return this.x +': '+ Highcharts.numberFormat(this.percentage, 1) +'% ('+Highcharts.numberFormat(this.y, 0, ',') +' millions)';}"))->setPlotOptions(array("area" => array("stacking" => 'percent', "lineColor" => '#ffffff', "lineWidth" => 1, "marker" => array("lineWidth" => 1, "lineColor" => "#ffffff"))))->addSeries('Asia', array(502, 635, 809, 947, 1402, 3634, 5268))->addSeries('Africa', array(106, 107, 111, 133, 221, 767, 1766))->addSeries('Europe', array(163, 203, 276, 408, 547, 729, 628))->addSeries('America', array(18, 31, 54, 156, 339, 818, 1201))->addSeries('Oceania', array(2, 2, 2, 6, 13, 30, 46));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 8
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");
//$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
// Tell the db that we use utf-8
//jqGridDB::query($conn,"SET NAMES utf8");
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "spline", "inverted" => true, "width" => 500, "style" => array("margin" => "0 auto")))->setTitle(array('text' => 'Atmosphere Temperature by Altitude'))->setSubtitle(array("text" => "According to the Standard Atmosphere Model"))->setxAxis(array("reversed" => false, "title" => array("enabled" => true, "text" => 'Altitude'), "labels" => array("formatter" => "js:function() {\n               return this.value +'km';\n            }"), "maxPadding" => 0.05, "showLastLabel" => true))->setyAxis(array("title" => array("text" => "Temperature C"), "labels" => array("formatter" => "js:function() {\n               return this.value + 'C';\n            }"), "lineWidth" => 2))->setTooltip(array("formatter" => "function(){return ''+  this.x +' km: '+ this.y +'C';}"))->setPlotOptions(array("spline" => array("marker" => array("enabled" => true))))->addSeries('Temperature', array(array(0, 15), array(10, -50), array(20, -56.5), array(30, -46.5), array(40, -22.1), array(50, -2.5), array(60, -27.7), array(70, -55.7), array(80, -76.5)));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 9
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->setChartOptions(array("margin" => array(50, 0, 0, 0), "plotBackgroundColor" => 'none', "plotBorderWidth" => 0, "plotShadow" => false))->setTitle(array('text' => 'Browser market shares at a specific website'))->setSubtitle(array('text' => 'Inner circle: 2008, outer circle: 2010'))->setTooltip(array("formatter" => "function(){return '<b>'+ this.point.name +'</b>: '+ this.y +' %';}"))->addSeries('2008', array(array("name" => 'Firefox', "y" => 44.2, "color" => '#4572A7'), array("name" => 'IE', "y" => 46.6, "color" => '#AA4643'), array("name" => 'Chrome', "y" => 3.1, "color" => '#89A54E'), array("name" => 'Safari', "y" => 2.7, "color" => '#80699B'), array("name" => 'Opera', "y" => 2.3, "color" => '#3D96AE'), array("name" => 'Mozilla', "y" => 0.4, "color" => '#DB843D')))->setSeriesOption('2008', array('type' => 'pie', 'size' => '45%', 'innerSize' => '20%', 'dataLabels' => array("enabled" => false)))->addSeries('2010', array(array("name" => 'Firefox', "y" => 45.0, "color" => '#4572A7'), array("name" => 'IE', "y" => 26.8, "color" => '#AA4643'), array("name" => 'Chrome', "y" => 12.8, "color" => '#89A54E'), array("name" => 'Safari', "y" => 8.5, "color" => '#80699B'), array("name" => 'Opera', "y" => 6.2, "color" => '#3D96AE'), array("name" => 'Mozilla', "y" => 0.2, "color" => '#DB843D')))->setSeriesOption('2010', array('type' => 'pie', 'innerSize' => '45%', 'dataLabels' => array("enabled" => true)));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 10
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "column"))->setTitle(array('text' => 'Stacked column chart'))->setxAxis(array("categories" => array('Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas')))->setyAxis(array("min" => 0, "title" => array("text" => "Total fruit consumption")))->setLegend(array("align" => 'right', "verticalAlign" => 'top', "x" => -100, "y" => 20, "floating" => true, "shadow" => false, "borderWidth" => 1, "backgroundColor" => '#CCC', "backgroundColor" => '#FFFFFF'))->setTooltip(array("formatter" => "function(){return '<b>'+ this.x +'</b><br/>'+this.series.name +': '+ this.y +'<br/>'+'Total: '+ this.point.stackTotal;}"))->setPlotOptions(array("column" => array("stacking" => "normal")))->addSeries('Jhon', array(5, 3, 4, 7, 2))->addSeries('Jane', array(2, 2, 3, 2, 1))->addSeries('Joe', array(3, 4, 4, 2, 5));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 11
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "area"))->setTitle(array('text' => 'Area chart with negative values'))->setxAxis(array("categories" => array('Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas')))->setTooltip(array("formatter" => "function(){return this.series.name +': '+ this.y +'';}"))->addSeries('Jhon', array(5, 3, 4, 7, 2))->addSeries('Jane', array(2, -2, -3, 2, 1))->addSeries('Joe', array(3, 4, 4, -2, 5));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 12
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");
//$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
// get the theme
$theme = 'dark-blue';
//isset ($_GET['theme']) ? $_GET['theme'] : "";
$dateformat = 'l, M j, Y';
//Let get first the data from csv
$newisits = array();
$allvisits = array();
$handle = fopen("analytics.csv", "r");
if ($handle) {
    while (($data = fgetcsv($handle, 3200, ",")) !== FALSE) {
        //$date = DateTime::createFromFormat($dateformat, $data[0]);
        $d = strtotime($data[0]) * 1000;
        $allvisits[] = array($d, (int) str_replace(",", "", $data[1]));
        $newisits[] = array($d, (int) str_replace(",", "", $data[2]));
    }
}
fclose($handle);
// create the chart instance
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "line"))->setTitle(array('text' => 'Daily visits at www.example.com'))->setSubtitle(array("text" => "Source: Google Analytics"))->setxAxis(array("type" => "datetime", "tickInterval" => 7 * 24 * 3600 * 1000, "tickWidth" => 0, "gridLineWidth" => 1, "labels" => array("align" => 'left', "x" => 3, "y" => -3)))->setyAxis(array(array("title" => array("text" => null), "labels" => array("align" => "left", "x" => 3, "y" => 16, "formatter" => "js:function(){return Highcharts.numberFormat(this.value, 0);}"), "showFirstLabel" => false), array("linkedTo" => 0, "gridLineWidth" => 0, "opposite" => true, "title" => array("text" => null), "labels" => array("align" => "right", "x" => -3, "y" => 16, "formatter" => "js:function(){return Highcharts.numberFormat(this.value, 0);}"), "showFirstLabel" => false)))->setTooltip(array("shared" => true, "crosshairs" => true))->setLegend(array("align" => "left", "verticalAlign" => 'top', "y" => 50, "borderWidth" => 0, "floating" => true))->setPlotOptions(array("series" => array("cursor" => "pointer", "point" => array("events" => array("click" => "js:function(event){\n\t\t\t\t\t// this refers to entry object again with data\n\t\t\t\t\tjQuery.jgrid.info_dialog(this.series.name, Highcharts.dateFormat('%A, %b %e, %Y', this.x) +':<br/> '+ this.y +' visits', 'Close',{buttonalign:'right',top:this.pageY, left:this.pageX, modal:false, overlay:0});\n\t\t\t\t\t\n\t\t\t\t}")), "marker" => array("lineWidth" => 1))))->addSeries('All Visits', $allvisits)->setSeriesOption('All Visits', array("lineWidth" => 4, "marker" => array("radius" => 4)))->setTheme($theme)->addSeries('New Visitors', $newisits);
echo $chart->renderChart('', true, 700, 350);
Esempio n. 13
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");
$clickevent = <<<LOAD
function(e) {
\t// find the clicked values and the series
\tvar x = e.xAxis[0].value,
\ty = e.yAxis[0].value,
\tseries = this.series[0];

\t// Add it
\tseries.addPoint([x, y]);
}
LOAD;
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "scatter", "margin" => array(70, 50, 60, 80)))->setChartEvent('click', $clickevent)->setTitle(array('text' => 'User supplied data'))->setSubtitle(array('text' => 'Click the plot area to add a point. Click a point to remove it.'))->setxAxis(array("minPadding" => 0.2, "maxPadding" => 0.2, "maxZoom" => 60))->setyAxis(array("title" => array("text" => "Value"), "minPadding" => 0.2, "maxPadding" => 0.2, "maxZoom" => 60, "plotLines" => array(array("value" => 0, "width" => 1, "color" => '#808080'))))->setPlotOptions(array("series" => array("lineWidth" => 1, "point" => array("events" => array("click" => "js:function(){if (this.series.data.length > 1) this.remove();}")))))->setLegend(array("enabled" => false))->setExporting('enabled', false)->addSeries('data', array(array(20, 20), array(80, 80)));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 14
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "bar"))->setTitle(array('text' => 'Historic World Population by Region'))->setSubtitle(array("text" => 'Source: Wikipedia.org'))->setxAxis(array("categories" => array('Africa', 'America', 'Asia', 'Europe', 'Oceania'), "title" => array("text" => null)))->setyAxis(array("min" => 0, "title" => array("text" => 'Population (millions)'), "align" => 'high'))->setTooltip(array("formatter" => "function(){return this.series.name +': '+ this.y +' millions';}"))->setPlotOptions(array("bar" => array("dataLabels" => array("states" => array("enabled" => true)))))->setLegend(array("layout" => 'vertical', "align" => 'right', "verticalAlign" => 'top', "x" => -100, "y" => 100, "floating" => true, "borderWidth" => 1, "backgroundColor" => '#FFFFFF', "shadow" => true))->addSeries('Year 1800', array(107, 31, 635, 203, 2))->addSeries('Year 1900', array(133, 156, 947, 408, 6))->addSeries('Year 2008', array(973, 914, 4054, 732, 34));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 15
0
require_once ABSPATH . "php/jqChart.php";
ini_set("display_errors", "1");
$loadevent = <<<LOAD
function() {  
\t// set up the updating of the chart each second
\tvar series = this.series[0];
\tsetInterval(function() {
\t\tvar x = (new Date()).getTime(), // current time
\t\ty = Math.random();
\t\tseries.addPoint([x, y], true, true);
\t}, 1000);
}
LOAD;
$randdata = <<<RNDATA
(function() {
// generate an array of random data
\tvar data = [],
\ttime = (new Date()).getTime(),
\ti;
\tfor (i = -19; i <= 0; i++) {
\t\tdata.push({
\t\t\tx: time + i * 1000,
\t\t\ty: Math.random()
\t\t});
\t}
\treturn data;
})()
RNDATA;
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "spline", "marginRight" => 10))->setChartEvent('load', $loadevent)->setTitle(array('text' => 'Live random data'))->setxAxis(array("type" => 'datetime', "tickPixelInterval" => 150))->setyAxis(array("title" => array("text" => "Value"), "plotLines" => array(array("value" => 0, "width" => 1, "color" => '#808080'))))->setTooltip(array("formatter" => "function(){return '<b>'+ this.series.name +'</b><br/>'+Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) +'<br/>'+Highcharts.numberFormat(this.y, 2);}"))->setLegend(array("enabled" => false))->setExporting('enabled', false)->addSeries('Random data', 'js:' . $randdata);
echo $chart->renderChart('', true, 700, 350);
Esempio n. 16
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "area", "spacingBottom" => 30))->setTitle(array('text' => 'Fruit consumption *'))->setSubtitle(array("text" => '* Jane\'s banana consumption is unknown', "floating" => true, "align" => "right", "verticalAlign" => 'bottom', "y" => 15))->setLegend(array("layout" => 'vertical', "align" => 'left', "verticalAlign" => 'top', "x" => 150, "y" => 100, "floating" => true, "borderWidth" => 1, "backgroundColor" => '#FFFFFF'))->setxAxis(array("categories" => array('Apples', 'Pears', 'Oranges', 'Bananas', 'Grapes', 'Plums', 'Strawberries', 'Raspberries')))->setyAxis(array("title" => array("text" => 'Y-Axis'), "labels" => array("formatter" => "js:function(){return this.value;}")))->setTooltip(array("formatter" => "function(){return '<b>'+ this.series.name +'</b><br/>'+this.x +': '+ this.y;}"))->setPlotOptions(array("area" => array("fillOpacity" => 0.5)))->addSeries('Jhon', array(0, 1, 4, 4, 5, 2, 3, 7))->addSeries('Jane', array(1, 0, 3, null, 3, 1, 2, 1));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 17
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$chart = new jqChart();
$chart->setChartOptions(array("reflow" => true, "zoomType" => "x", "spacingRight" => 20))->setTitle(array('text' => 'USD to EUR exchange rate from 2006 through 2008'))->setSubtitle(array("text" => "Click and drag in the plot area to zoom in"))->setxAxis(array("type" => "datetime", "maxZoom" => 14 * 24 * 3600000, "title" => array("text" => null)))->setyAxis(array("title" => array("text" => "Exchange Rate"), "min" => 0.6, "startOnTick" => false, "showFirstLabel" => false))->setTooltip("shared", true)->setLegend("enabled", false)->setPlotOptions(array("area" => array("lineWidth" => 1, "marker" => array("enabled" => false, "states" => array("hover" => array("enabled" => true, "radius" => 5))), "shadow" => false, "states" => array("hover" => array("lineWidth" => 1)))))->addSeries('USD to EUR', array(0.8446, 0.8445, 0.8444, 0.8451, 0.8418, 0.8264, 0.8258, 0.8232, 0.8233, 0.8258, 0.8283, 0.8278, 0.8256, 0.8292, 0.8239, 0.8239, 0.8245, 0.8265, 0.8260999999999999, 0.8269, 0.8273, 0.8244, 0.8244, 0.8172, 0.8139, 0.8146, 0.8164, 0.82, 0.8269, 0.8269, 0.8269, 0.8258, 0.8247, 0.8286, 0.8289, 0.8316, 0.832, 0.8333, 0.8352000000000001, 0.8357, 0.8355, 0.8354, 0.8403, 0.8403, 0.8406, 0.8403, 0.8396, 0.8418, 0.8409, 0.8384, 0.8386, 0.8372000000000001, 0.839, 0.84, 0.8389, 0.84, 0.8423, 0.8423, 0.8435, 0.8421999999999999, 0.838, 0.8373, 0.8316, 0.8303, 0.8303, 0.8302, 0.8369, 0.84, 0.8385, 0.84, 0.8401, 0.8401999999999999, 0.8381, 0.8351, 0.8314, 0.8273, 0.8213, 0.8207, 0.8207, 0.8215, 0.8242, 0.8273, 0.8300999999999999, 0.8346, 0.8312, 0.8312, 0.8312, 0.8306, 0.8327, 0.8282, 0.824, 0.8255, 0.8256, 0.8273, 0.8209, 0.8151, 0.8149, 0.8213, 0.8273, 0.8273, 0.8260999999999999, 0.8252, 0.824, 0.8262, 0.8258, 0.8260999999999999, 0.826, 0.8199, 0.8153, 0.8097, 0.8101, 0.8119, 0.8107, 0.8105, 0.8084, 0.8069, 0.8047, 0.8023, 0.7965, 0.7919, 0.7921, 0.7922, 0.7934, 0.7917999999999999, 0.7915, 0.787, 0.7861, 0.7861, 0.7853, 0.7867, 0.7827, 0.7834, 0.7766, 0.7751, 0.7739, 0.7766999999999999, 0.7802, 0.7788, 0.7828000000000001, 0.7816, 0.7829, 0.783, 0.7829, 0.7781, 0.7811, 0.7831, 0.7826, 0.7855, 0.7855, 0.7845, 0.7798, 0.7776999999999999, 0.7822, 0.7785, 0.7744, 0.7743, 0.7726, 0.7766, 0.7806, 0.785, 0.7907, 0.7912, 0.7913, 0.7931, 0.7952, 0.7951, 0.7927999999999999, 0.791, 0.7913, 0.7912, 0.7941, 0.7953, 0.7921, 0.7919, 0.7968, 0.7999000000000001, 0.7999000000000001, 0.7974, 0.7942, 0.796, 0.7969000000000001, 0.7862, 0.7821, 0.7821, 0.7821, 0.7811, 0.7833, 0.7849, 0.7819, 0.7809, 0.7809, 0.7827, 0.7848000000000001, 0.785, 0.7873, 0.7894, 0.7907, 0.7909, 0.7947, 0.7987, 0.799, 0.7927, 0.79, 0.7877999999999999, 0.7877999999999999, 0.7907, 0.7922, 0.7937, 0.786, 0.787, 0.7838000000000001, 0.7838000000000001, 0.7837, 0.7836, 0.7806, 0.7825, 0.7798, 0.777, 0.777, 0.7772, 0.7793, 0.7788, 0.7785, 0.7832, 0.7865, 0.7865, 0.7853, 0.7847, 0.7809, 0.778, 0.7799, 0.78, 0.7801, 0.7765, 0.7785, 0.7811, 0.782, 0.7835, 0.7845, 0.7844, 0.782, 0.7811, 0.7795, 0.7794, 0.7806, 0.7794, 0.7794, 0.7778, 0.7793, 0.7808, 0.7824, 0.787, 0.7894, 0.7893, 0.7882, 0.7871, 0.7882, 0.7871, 0.7877999999999999, 0.79, 0.7901, 0.7897999999999999, 0.7879, 0.7886, 0.7858000000000001, 0.7814, 0.7825, 0.7826, 0.7826, 0.786, 0.7877999999999999, 0.7868000000000001, 0.7883, 0.7893, 0.7892, 0.7876, 0.785, 0.787, 0.7873, 0.7901, 0.7936, 0.7939000000000001, 0.7938, 0.7956, 0.7975, 0.7978, 0.7972, 0.7995, 0.7995, 0.7994, 0.7976, 0.7977, 0.796, 0.7922, 0.7927999999999999, 0.7929, 0.7948, 0.797, 0.7953, 0.7907, 0.7872, 0.7852, 0.7852, 0.786, 0.7862, 0.7836, 0.7837, 0.784, 0.7867, 0.7867, 0.7869, 0.7837, 0.7827, 0.7825, 0.7779, 0.7791, 0.779, 0.7786999999999999, 0.78, 0.7806999999999999, 0.7803, 0.7817, 0.7799, 0.7799, 0.7795, 0.7801, 0.7765, 0.7725, 0.7683, 0.7641, 0.7639, 0.7616000000000001, 0.7608, 0.759, 0.7582, 0.7539, 0.75, 0.75, 0.7507, 0.7504999999999999, 0.7516, 0.7522, 0.7531, 0.7577, 0.7577, 0.7582, 0.755, 0.7542, 0.7576000000000001, 0.7616000000000001, 0.7648, 0.7648, 0.7641, 0.7614, 0.757, 0.7587, 0.7588, 0.762, 0.762, 0.7617, 0.7618, 0.7615, 0.7612, 0.7596000000000001, 0.758, 0.758, 0.758, 0.7547, 0.7549, 0.7613, 0.7655, 0.7693, 0.7694, 0.7688, 0.7678, 0.7708, 0.7727000000000001, 0.7749, 0.7741, 0.7741, 0.7732, 0.7727000000000001, 0.7737000000000001, 0.7724, 0.7712, 0.772, 0.7721, 0.7717000000000001, 0.7704, 0.769, 0.7711, 0.774, 0.7745, 0.7745, 0.774, 0.7716, 0.7713, 0.7678, 0.7688, 0.7718, 0.7718, 0.7728, 0.7729, 0.7698, 0.7685, 0.7681, 0.769, 0.769, 0.7698, 0.7699, 0.7651, 0.7613, 0.7616000000000001, 0.7614, 0.7614, 0.7607, 0.7602, 0.7611, 0.7622, 0.7615, 0.7598, 0.7598, 0.7592, 0.7573, 0.7566000000000001, 0.7567, 0.7591, 0.7582, 0.7585, 0.7613, 0.7631, 0.7615, 0.76, 0.7613, 0.7627, 0.7627, 0.7608, 0.7583, 0.7575, 0.7562, 0.752, 0.7512, 0.7512, 0.7517, 0.752, 0.7511, 0.748, 0.7509, 0.7531, 0.7531, 0.7527, 0.7498, 0.7493, 0.7504, 0.75, 0.7491, 0.7491, 0.7485000000000001, 0.7484, 0.7492, 0.7471, 0.7459, 0.7477, 0.7477, 0.7483, 0.7458, 0.7448, 0.743, 0.7399, 0.7395, 0.7395, 0.7378, 0.7382, 0.7362, 0.7355, 0.7348, 0.7361, 0.7361, 0.7365, 0.7362, 0.7331, 0.7339, 0.7344000000000001, 0.7327, 0.7327, 0.7336, 0.7333, 0.7359, 0.7359, 0.7372, 0.736, 0.736, 0.735, 0.7365, 0.7383999999999999, 0.7395, 0.7413, 0.7397, 0.7396, 0.7385, 0.7378, 0.7366, 0.74, 0.7411, 0.7406, 0.7405, 0.7413999999999999, 0.7431, 0.7431, 0.7438, 0.7443, 0.7443, 0.7443, 0.7433999999999999, 0.7429, 0.7442, 0.744, 0.7439, 0.7437, 0.7437, 0.7429, 0.7403, 0.7399, 0.7418, 0.7468, 0.748, 0.748, 0.749, 0.7494, 0.7522, 0.7514999999999999, 0.7502, 0.7472, 0.7472, 0.7462, 0.7455000000000001, 0.7449, 0.7467, 0.7458, 0.7427, 0.7427, 0.743, 0.7429, 0.744, 0.743, 0.7422, 0.7388, 0.7388, 0.7369, 0.7345, 0.7345, 0.7345, 0.7352, 0.7341, 0.7341, 0.734, 0.7324000000000001, 0.7272, 0.7264, 0.7255, 0.7258, 0.7258, 0.7256, 0.7257, 0.7247, 0.7243000000000001, 0.7244, 0.7235, 0.7235, 0.7235, 0.7235, 0.7262, 0.7288, 0.7301, 0.7337, 0.7337, 0.7324000000000001, 0.7297, 0.7317, 0.7315, 0.7288, 0.7262999999999999, 0.7262999999999999, 0.7242, 0.7252999999999999, 0.7264, 0.727, 0.7312, 0.7305, 0.7305, 0.7318, 0.7358, 0.7409, 0.7454, 0.7437, 0.7423999999999999, 0.7423999999999999, 0.7415, 0.7419, 0.7413999999999999, 0.7377, 0.7355, 0.7315, 0.7315, 0.732, 0.7332, 0.7346, 0.7328, 0.7323, 0.734, 0.734, 0.7336, 0.7351, 0.7346, 0.7321, 0.7294, 0.7266, 0.7266, 0.7254, 0.7242, 0.7213000000000001, 0.7197, 0.7209, 0.721, 0.721, 0.721, 0.7209, 0.7159, 0.7133, 0.7105, 0.7099, 0.7099, 0.7093, 0.7093, 0.7076, 0.707, 0.7049, 0.7012, 0.7010999999999999, 0.7019, 0.7046, 0.7063, 0.7089, 0.7077, 0.7077, 0.7077, 0.7091, 0.7118, 0.7079, 0.7053, 0.705, 0.7055, 0.7055, 0.7045, 0.7050999999999999, 0.7050999999999999, 0.7017, 0.7, 0.6995, 0.6994, 0.7014, 0.7036, 0.7020999999999999, 0.7002, 0.6967, 0.695, 0.695, 0.6939, 0.694, 0.6922, 0.6919, 0.6914, 0.6894, 0.6891, 0.6904, 0.6889999999999999, 0.6834, 0.6823, 0.6807, 0.6815, 0.6815, 0.6847, 0.6859, 0.6822, 0.6827, 0.6837, 0.6823, 0.6822, 0.6822, 0.6792, 0.6746, 0.6735, 0.6731, 0.6742, 0.6744, 0.6739000000000001, 0.6731, 0.6761, 0.6761, 0.6785, 0.6818, 0.6836, 0.6823, 0.6805, 0.6793, 0.6849, 0.6833, 0.6825, 0.6825, 0.6816, 0.6798999999999999, 0.6813, 0.6808999999999999, 0.6868, 0.6933, 0.6933, 0.6945, 0.6944, 0.6946, 0.6964, 0.6965, 0.6956, 0.6956, 0.695, 0.6948, 0.6928, 0.6887, 0.6824, 0.6794, 0.6794, 0.6803, 0.6855, 0.6824, 0.6791, 0.6783, 0.6785, 0.6785, 0.6797, 0.68, 0.6803, 0.6805, 0.676, 0.677, 0.677, 0.6736, 0.6726, 0.6764, 0.6821, 0.6831, 0.6842, 0.6842, 0.6887, 0.6903, 0.6848, 0.6824, 0.6788, 0.6814, 0.6814, 0.6797, 0.6768999999999999, 0.6765, 0.6733, 0.6729000000000001, 0.6758, 0.6758, 0.675, 0.678, 0.6833, 0.6856, 0.6903, 0.6896, 0.6896, 0.6882, 0.6879, 0.6862, 0.6852, 0.6823, 0.6813, 0.6813, 0.6822, 0.6802, 0.6802, 0.6784, 0.6748, 0.6747, 0.6747, 0.6748, 0.6733, 0.665, 0.6611, 0.6583, 0.659, 0.659, 0.6581, 0.6578000000000001, 0.6574, 0.6532, 0.6502, 0.6514, 0.6514, 0.6506999999999999, 0.651, 0.6489, 0.6424, 0.6405999999999999, 0.6382, 0.6382, 0.6341, 0.6344, 0.6378, 0.6439, 0.6478, 0.6481, 0.6481, 0.6494, 0.6438, 0.6377, 0.6329, 0.6336000000000001, 0.6333, 0.6333, 0.633, 0.6371, 0.6403, 0.6395999999999999, 0.6364, 0.6356000000000001, 0.6356000000000001, 0.6368, 0.6357, 0.6354, 0.632, 0.6332, 0.6328, 0.6331, 0.6342, 0.6321, 0.6302, 0.6278, 0.6308, 0.6324, 0.6324, 0.6307, 0.6277, 0.6269, 0.6335, 0.6392, 0.64, 0.6401, 0.6395999999999999, 0.6407, 0.6423, 0.6429, 0.6472, 0.6485, 0.6486, 0.6467000000000001, 0.6444, 0.6467000000000001, 0.6509, 0.6478, 0.6461, 0.6461, 0.6468, 0.6449, 0.647, 0.6461, 0.6452, 0.6422, 0.6422, 0.6425, 0.6414, 0.6366000000000001, 0.6346000000000001, 0.635, 0.6346000000000001, 0.6346000000000001, 0.6343, 0.6346000000000001, 0.6379, 0.6415999999999999, 0.6442, 0.6431, 0.6431, 0.6435, 0.644, 0.6473, 0.6469, 0.6385999999999999, 0.6356000000000001, 0.634, 0.6346000000000001, 0.643, 0.6452, 0.6467000000000001, 0.6506, 0.6504, 0.6503, 0.6481, 0.6451, 0.645, 0.6441, 0.6414, 0.6409, 0.6409, 0.6428, 0.6431, 0.6418, 0.6371, 0.6349, 0.6333, 0.6334, 0.6338, 0.6342, 0.632, 0.6318, 0.637, 0.6368, 0.6368, 0.6383, 0.6371, 0.6371, 0.6355, 0.632, 0.6277, 0.6276, 0.6291, 0.6274, 0.6293, 0.6311, 0.631, 0.6312, 0.6312, 0.6304, 0.6294, 0.6348, 0.6378, 0.6368, 0.6368, 0.6368, 0.636, 0.637, 0.6418, 0.6411, 0.6435, 0.6427, 0.6427, 0.6419, 0.6446, 0.6468, 0.6487000000000001, 0.6594, 0.6666, 0.6666, 0.6677999999999999, 0.6712, 0.6705, 0.6718, 0.6784, 0.6811, 0.6811, 0.6794, 0.6804, 0.6781, 0.6756, 0.6735, 0.6763, 0.6762, 0.6777, 0.6815, 0.6802, 0.678, 0.6796, 0.6817, 0.6817, 0.6832, 0.6877, 0.6912, 0.6914, 0.7009, 0.7012, 0.701, 0.7005, 0.7076, 0.7087, 0.717, 0.7105, 0.7030999999999999, 0.7029, 0.7006, 0.7035, 0.7045, 0.6956, 0.6988, 0.6915, 0.6914, 0.6859, 0.6778, 0.6815, 0.6815, 0.6843, 0.6846, 0.6846, 0.6923, 0.6997, 0.7098, 0.7188, 0.7232, 0.7262, 0.7266, 0.7359, 0.7368, 0.7337, 0.7317, 0.7387, 0.7467, 0.7461, 0.7366, 0.7319, 0.7361, 0.7437, 0.7432, 0.7461, 0.7461, 0.7454, 0.7549, 0.7742, 0.7801, 0.7903, 0.7876, 0.7927999999999999, 0.7991, 0.8007, 0.7823, 0.7661, 0.785, 0.7863, 0.7862, 0.7821, 0.7858000000000001, 0.7731, 0.7779, 0.7844, 0.7866, 0.7864, 0.7788, 0.7875, 0.7971, 0.8004, 0.7857, 0.7932, 0.7938, 0.7927, 0.7917999999999999, 0.7919, 0.7989000000000001, 0.7988, 0.7949000000000001, 0.7948, 0.7882, 0.7745, 0.771, 0.775, 0.7791, 0.7882, 0.7882, 0.7899, 0.7905, 0.7889, 0.7879, 0.7855, 0.7866, 0.7865, 0.7795, 0.7758, 0.7717000000000001, 0.761, 0.7497, 0.7471, 0.7473, 0.7407, 0.7288, 0.7074, 0.6927, 0.7083, 0.7191, 0.719, 0.7153, 0.7156, 0.7158, 0.714, 0.7119, 0.7129, 0.7129, 0.7049, 0.7095))->setSeriesOption('USD to EUR', array("type" => "area", "pointInterval" => 24 * 3600 * 1000, "pointStart" => "js:Date.UTC(2006, 0, 01)"));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 18
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "bar"))->setTitle(array('text' => 'Stacked bar chart'))->setxAxis(array("categories" => array('Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas')))->setyAxis(array("min" => 0, "title" => array("text" => "Total fruit consumption")))->setLegend(array("backgroundColor" => '#FFFFFF', "reversed" => true))->setTooltip(array("formatter" => "function(){return this.series.name +': '+ this.y +'';}"))->setPlotOptions(array("series" => array("stacking" => 'normal')))->addSeries('Jhon', array(5, 3, 4, 7, 2))->addSeries('Jane', array(2, 2, 3, 2, 1))->addSeries('Joe', array(3, 4, 4, 2, 5));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 19
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "scatter", "zoomType" => "xy"))->setTitle(array('text' => 'Height Versus Weight of 507 Individuals by Gender'))->setSubtitle(array("text" => "Source: Heinz  2003"))->setxAxis(array("title" => array("enabled" => true, "text" => "Height (cm)"), "startOnTick" => true, "endOnTick" => true, "showLastLabel" => true))->setyAxis(array("title" => array("text" => "Weight (kg)")))->setTooltip(array("formatter" => "function(){ return this.x +' cm, '+ this.y +' kg';}"))->setLegend(array("layout" => 'vertical', "align" => 'left', "verticalAlign" => 'top', "x" => 100, "y" => 70, "floating" => true, "backgroundColor" => '#FFFFFF', "borderWidth" => 1))->setPlotOptions(array("scatter" => array("marker" => array("radius" => 5, "states" => array("hover" => array("enabled" => true, "lineColor" => 'rgb(100,100,100)'))), "states" => array("hover" => array("marker" => array("enabled" => false))))))->addSeries('Female', array(array(161.2, 51.6), array(167.5, 59.0), array(159.5, 49.2), array(157.0, 63.0), array(155.8, 53.6), array(170.0, 59.0), array(159.1, 47.6), array(166.0, 69.8), array(176.2, 66.8), array(160.2, 75.2), array(172.5, 55.2), array(170.9, 54.2), array(172.9, 62.5), array(153.4, 42.0), array(160.0, 50.0), array(147.2, 49.8), array(168.2, 49.2), array(175.0, 73.2), array(157.0, 47.8), array(167.6, 68.8), array(159.5, 50.6), array(175.0, 82.5), array(166.8, 57.2), array(176.5, 87.8), array(170.2, 72.8), array(174.0, 54.5), array(173.0, 59.8), array(179.9, 67.3), array(170.5, 67.8), array(160.0, 47.0), array(154.4, 46.2), array(162.0, 55.0), array(176.5, 83.0), array(160.0, 54.4), array(152.0, 45.8), array(162.1, 53.6), array(170.0, 73.2), array(160.2, 52.1), array(161.3, 67.90000000000001), array(166.4, 56.6), array(168.9, 62.3), array(163.8, 58.5), array(167.6, 54.5), array(160.0, 50.2), array(161.3, 60.3), array(167.6, 58.3), array(165.1, 56.2), array(160.0, 50.2), array(170.0, 72.90000000000001), array(157.5, 59.8), array(167.6, 61.0), array(160.7, 69.09999999999999), array(163.2, 55.9), array(152.4, 46.5), array(157.5, 54.3), array(168.3, 54.8), array(180.3, 60.7), array(165.5, 60.0), array(165.0, 62.0), array(164.5, 60.3), array(156.0, 52.7), array(160.0, 74.3), array(163.0, 62.0), array(165.7, 73.09999999999999), array(161.0, 80.0), array(162.0, 54.7), array(166.0, 53.2), array(174.0, 75.7), array(172.7, 61.1), array(167.6, 55.7), array(151.1, 48.7), array(164.5, 52.3), array(163.5, 50.0), array(152.0, 59.3), array(169.0, 62.5), array(164.0, 55.7), array(161.2, 54.8), array(155.0, 45.9), array(170.0, 70.59999999999999), array(176.2, 67.2), array(170.0, 69.40000000000001), array(162.5, 58.2), array(170.3, 64.8), array(164.1, 71.59999999999999), array(169.5, 52.8), array(163.2, 59.8), array(154.5, 49.0), array(159.8, 50.0), array(173.2, 69.2), array(170.0, 55.9), array(161.4, 63.4), array(169.0, 58.2), array(166.2, 58.6), array(159.4, 45.7), array(162.5, 52.2), array(159.0, 48.6), array(162.8, 57.8), array(159.0, 55.6), array(179.8, 66.8), array(162.9, 59.4), array(161.0, 53.6), array(151.1, 73.2), array(168.2, 53.4), array(168.9, 69.0), array(173.2, 58.4), array(171.8, 56.2), array(178.0, 70.59999999999999), array(164.3, 59.8), array(163.0, 72.0), array(168.5, 65.2), array(166.8, 56.6), array(172.7, 105.2), array(163.5, 51.8), array(169.4, 63.4), array(167.8, 59.0), array(159.5, 47.6), array(167.6, 63.0), array(161.2, 55.2), array(160.0, 45.0), array(163.2, 54.0), array(162.2, 50.2), array(161.3, 60.2), array(149.5, 44.8), array(157.5, 58.8), array(163.2, 56.4), array(172.7, 62.0), array(155.0, 49.2), array(156.5, 67.2), array(164.0, 53.8), array(160.9, 54.4), array(162.8, 58.0), array(167.0, 59.8), array(160.0, 54.8), array(160.0, 43.2), array(168.9, 60.5), array(158.2, 46.4), array(156.0, 64.40000000000001), array(160.0, 48.8), array(167.1, 62.2), array(158.0, 55.5), array(167.6, 57.8), array(156.0, 54.6), array(162.1, 59.2), array(173.4, 52.7), array(159.8, 53.2), array(170.5, 64.5), array(159.2, 51.8), array(157.5, 56.0), array(161.3, 63.6), array(162.6, 63.2), array(160.0, 59.5), array(168.9, 56.8), array(165.1, 64.09999999999999), array(162.6, 50.0), array(165.1, 72.3), array(166.4, 55.0), array(160.0, 55.9), array(152.4, 60.4), array(170.2, 69.09999999999999), array(162.6, 84.5), array(170.2, 55.9), array(158.8, 55.5), array(172.7, 69.5), array(167.6, 76.40000000000001), array(162.6, 61.4), array(167.6, 65.90000000000001), array(156.2, 58.6), array(175.2, 66.8), array(172.1, 56.6), array(162.6, 58.6), array(160.0, 55.9), array(165.1, 59.1), array(182.9, 81.8), array(166.4, 70.7), array(165.1, 56.8), array(177.8, 60.0), array(165.1, 58.2), array(175.3, 72.7), array(154.9, 54.1), array(158.8, 49.1), array(172.7, 75.90000000000001), array(168.9, 55.0), array(161.3, 57.3), array(167.6, 55.0), array(165.1, 65.5), array(175.3, 65.5), array(157.5, 48.6), array(163.8, 58.6), array(167.6, 63.6), array(165.1, 55.2), array(165.1, 62.7), array(168.9, 56.6), array(162.6, 53.9), array(164.5, 63.2), array(176.5, 73.59999999999999), array(168.9, 62.0), array(175.3, 63.6), array(159.4, 53.2), array(160.0, 53.4), array(170.2, 55.0), array(162.6, 70.5), array(167.6, 54.5), array(162.6, 54.5), array(160.7, 55.9), array(160.0, 59.0), array(157.5, 63.6), array(162.6, 54.5), array(152.4, 47.3), array(170.2, 67.7), array(165.1, 80.90000000000001), array(172.7, 70.5), array(165.1, 60.9), array(170.2, 63.6), array(170.2, 54.5), array(170.2, 59.1), array(161.3, 70.5), array(167.6, 52.7), array(167.6, 62.7), array(165.1, 86.3), array(162.6, 66.40000000000001), array(152.4, 67.3), array(168.9, 63.0), array(170.2, 73.59999999999999), array(175.2, 62.3), array(175.2, 57.7), array(160.0, 55.4), array(165.1, 104.1), array(174.0, 55.5), array(170.2, 77.3), array(160.0, 80.5), array(167.6, 64.5), array(167.6, 72.3), array(167.6, 61.4), array(154.9, 58.2), array(162.6, 81.8), array(175.3, 63.6), array(171.4, 53.4), array(157.5, 54.5), array(165.1, 53.6), array(160.0, 60.0), array(174.0, 73.59999999999999), array(162.6, 61.4), array(174.0, 55.5), array(162.6, 63.6), array(161.3, 60.9), array(156.2, 60.0), array(149.9, 46.8), array(169.5, 57.3), array(160.0, 64.09999999999999), array(175.3, 63.6), array(169.5, 67.3), array(160.0, 75.5), array(172.7, 68.2), array(162.6, 61.4), array(157.5, 76.8), array(176.5, 71.8), array(164.4, 55.5), array(160.7, 48.6), array(174.0, 66.40000000000001), array(163.8, 67.3)))->setSeriesOption('Female', array("color" => 'rgba(223, 83, 83, .5)'))->addSeries('Male', array(array(174.0, 65.59999999999999), array(175.3, 71.8), array(193.5, 80.7), array(186.5, 72.59999999999999), array(187.2, 78.8), array(181.5, 74.8), array(184.0, 86.40000000000001), array(184.5, 78.40000000000001), array(175.0, 62.0), array(184.0, 81.59999999999999), array(180.0, 76.59999999999999), array(177.8, 83.59999999999999), array(192.0, 90.0), array(176.0, 74.59999999999999), array(174.0, 71.0), array(184.0, 79.59999999999999), array(192.7, 93.8), array(171.5, 70.0), array(173.0, 72.40000000000001), array(176.0, 85.90000000000001), array(176.0, 78.8), array(180.5, 77.8), array(172.7, 66.2), array(176.0, 86.40000000000001), array(173.5, 81.8), array(178.0, 89.59999999999999), array(180.3, 82.8), array(180.3, 76.40000000000001), array(164.5, 63.2), array(173.0, 60.9), array(183.5, 74.8), array(175.5, 70.0), array(188.0, 72.40000000000001), array(189.2, 84.09999999999999), array(172.8, 69.09999999999999), array(170.0, 59.5), array(182.0, 67.2), array(170.0, 61.3), array(177.8, 68.59999999999999), array(184.2, 80.09999999999999), array(186.7, 87.8), array(171.4, 84.7), array(172.7, 73.40000000000001), array(175.3, 72.09999999999999), array(180.3, 82.59999999999999), array(182.9, 88.7), array(188.0, 84.09999999999999), array(177.2, 94.09999999999999), array(172.1, 74.90000000000001), array(167.0, 59.1), array(169.5, 75.59999999999999), array(174.0, 86.2), array(172.7, 75.3), array(182.2, 87.09999999999999), array(164.1, 55.2), array(163.0, 57.0), array(171.5, 61.4), array(184.2, 76.8), array(174.0, 86.8), array(174.0, 72.2), array(177.0, 71.59999999999999), array(186.0, 84.8), array(167.0, 68.2), array(171.8, 66.09999999999999), array(182.0, 72.0), array(167.0, 64.59999999999999), array(177.8, 74.8), array(164.5, 70.0), array(192.0, 101.6), array(175.5, 63.2), array(171.2, 79.09999999999999), array(181.6, 78.90000000000001), array(167.4, 67.7), array(181.1, 66.0), array(177.0, 68.2), array(174.5, 63.9), array(177.5, 72.0), array(170.5, 56.8), array(182.4, 74.5), array(197.1, 90.90000000000001), array(180.1, 93.0), array(175.5, 80.90000000000001), array(180.6, 72.7), array(184.4, 68.0), array(175.5, 70.90000000000001), array(180.6, 72.5), array(177.0, 72.5), array(177.1, 83.40000000000001), array(181.6, 75.5), array(176.5, 73.0), array(175.0, 70.2), array(174.0, 73.40000000000001), array(165.1, 70.5), array(177.0, 68.90000000000001), array(192.0, 102.3), array(176.5, 68.40000000000001), array(169.4, 65.90000000000001), array(182.1, 75.7), array(179.8, 84.5), array(175.3, 87.7), array(184.9, 86.40000000000001), array(177.3, 73.2), array(167.4, 53.9), array(178.1, 72.0), array(168.9, 55.5), array(157.2, 58.4), array(180.3, 83.2), array(170.2, 72.7), array(177.8, 64.09999999999999), array(172.7, 72.3), array(165.1, 65.0), array(186.7, 86.40000000000001), array(165.1, 65.0), array(174.0, 88.59999999999999), array(175.3, 84.09999999999999), array(185.4, 66.8), array(177.8, 75.5), array(180.3, 93.2), array(180.3, 82.7), array(177.8, 58.0), array(177.8, 79.5), array(177.8, 78.59999999999999), array(177.8, 71.8), array(177.8, 116.4), array(163.8, 72.2), array(188.0, 83.59999999999999), array(198.1, 85.5), array(175.3, 90.90000000000001), array(166.4, 85.90000000000001), array(190.5, 89.09999999999999), array(166.4, 75.0), array(177.8, 77.7), array(179.7, 86.40000000000001), array(172.7, 90.90000000000001), array(190.5, 73.59999999999999), array(185.4, 76.40000000000001), array(168.9, 69.09999999999999), array(167.6, 84.5), array(175.3, 64.5), array(170.2, 69.09999999999999), array(190.5, 108.6), array(177.8, 86.40000000000001), array(190.5, 80.90000000000001), array(177.8, 87.7), array(184.2, 94.5), array(176.5, 80.2), array(177.8, 72.0), array(180.3, 71.40000000000001), array(171.4, 72.7), array(172.7, 84.09999999999999), array(172.7, 76.8), array(177.8, 63.6), array(177.8, 80.90000000000001), array(182.9, 80.90000000000001), array(170.2, 85.5), array(167.6, 68.59999999999999), array(175.3, 67.7), array(165.1, 66.40000000000001), array(185.4, 102.3), array(181.6, 70.5), array(172.7, 95.90000000000001), array(190.5, 84.09999999999999), array(179.1, 87.3), array(175.3, 71.8), array(170.2, 65.90000000000001), array(193.0, 95.90000000000001), array(171.4, 91.40000000000001), array(177.8, 81.8), array(177.8, 96.8), array(167.6, 69.09999999999999), array(167.6, 82.7), array(180.3, 75.5), array(182.9, 79.5), array(176.5, 73.59999999999999), array(186.7, 91.8), array(188.0, 84.09999999999999), array(188.0, 85.90000000000001), array(177.8, 81.8), array(174.0, 82.5), array(177.8, 80.5), array(171.4, 70.0), array(185.4, 81.8), array(185.4, 84.09999999999999), array(188.0, 90.5), array(188.0, 91.40000000000001), array(182.9, 89.09999999999999), array(176.5, 85.0), array(175.3, 69.09999999999999), array(175.3, 73.59999999999999), array(188.0, 80.5), array(188.0, 82.7), array(175.3, 86.40000000000001), array(170.5, 67.7), array(179.1, 92.7), array(177.8, 93.59999999999999), array(175.3, 70.90000000000001), array(182.9, 75.0), array(170.8, 93.2), array(188.0, 93.2), array(180.3, 77.7), array(177.8, 61.4), array(185.4, 94.09999999999999), array(168.9, 75.0), array(185.4, 83.59999999999999), array(180.3, 85.5), array(174.0, 73.90000000000001), array(167.6, 66.8), array(182.9, 87.3), array(160.0, 72.3), array(180.3, 88.59999999999999), array(167.6, 75.5), array(186.7, 101.4), array(175.3, 91.09999999999999), array(175.3, 67.3), array(175.9, 77.7), array(175.3, 81.8), array(179.1, 75.5), array(181.6, 84.5), array(177.8, 76.59999999999999), array(182.9, 85.0), array(177.8, 102.5), array(184.2, 77.3), array(179.1, 71.8), array(176.5, 87.90000000000001), array(188.0, 94.3), array(174.0, 70.90000000000001), array(167.6, 64.5), array(170.2, 77.3), array(167.6, 72.3), array(188.0, 87.3), array(174.0, 80.0), array(176.5, 82.3), array(180.3, 73.59999999999999), array(167.6, 74.09999999999999), array(188.0, 85.90000000000001), array(180.3, 73.2), array(167.6, 76.3), array(183.0, 65.90000000000001), array(183.0, 90.90000000000001), array(179.1, 89.09999999999999), array(170.2, 62.3), array(177.8, 82.7), array(179.1, 79.09999999999999), array(190.5, 98.2), array(177.8, 84.09999999999999), array(180.3, 83.2), array(180.3, 83.2)))->setSeriesOption('Male', array("color" => 'rgba(119, 152, 191, .5)'));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 20
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);
Esempio n. 21
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);
Esempio n. 22
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");
//$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
// Tell the db that we use utf-8
//jqGridDB::query($conn,"SET NAMES utf8");
$plotbands = array(array("from" => 0.3, "to" => 1.5, "color" => 'rgba(68, 170, 213, 0.1)', "label" => array("text" => 'Light air', "style" => array("color" => '#606060'))), array("from" => 1.5, "to" => 3.3, "color" => 'rgba(0, 0, 0, 0)', "label" => array("text" => 'Light breeze', "style" => array("color" => '#606060'))), array("from" => 3.3, "to" => 5.5, "color" => 'rgba(68, 170, 213, 0.1)', "label" => array("text" => 'Gentle breeze', "style" => array("color" => '#606060'))), array("from" => 5.5, "to" => 8, "color" => 'rgba(0, 0, 0, 0)', "label" => array("text" => 'Moderate breeze', "style" => array("color" => '#606060'))), array("from" => 8, "to" => 11, "color" => 'rgba(68, 170, 213, 0.1)', "label" => array("text" => 'Fresh breeze', "style" => array("color" => '#606060'))), array("from" => 11, "to" => 14, "color" => 'rgba(0, 0, 0, 0)', "label" => array("text" => 'Strong breeze', "style" => array("color" => '#606060'))), array("from" => 14, "to" => 15, "color" => 'rgba(68, 170, 213, 0.1)', "label" => array("text" => 'High wind', "style" => array("color" => '#606060'))));
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "spline"))->setTitle(array('text' => 'Wind speed during two days'))->setSubtitle(array("text" => "October 6th and 7th 2009 at two locations in Vik i Sogn, Norway"))->setxAxis(array("type" => "datetime"))->setyAxis(array("title" => array("text" => 'Wind speed (m/s)'), "min" => 0, "minorGridLineWidth" => 0, "gridLineWidth" => 0, "alternateGridColor" => null, "plotBands" => $plotbands))->setTooltip(array("formatter" => "function(){return ''+Highcharts.dateFormat('%e. %b %Y, %H:00', this.x) +': '+ this.y +' m/s';}"))->setPlotOptions(array("spline" => array("lineWidth" => 4, "states" => array("hover" => array("lineWidth" => 5)), "marker" => array("enabled" => true, "states" => array("hover" => array("lineWidth" => 1, "radius" => 5, "enabled" => true, "symbol" => "circle"))), "pointInterval" => 3600000, "pointStart" => 'js:Date.UTC(2009, 9, 6, 0, 0, 0)')))->addSeries('Hestavollane', array(4.3, 5.1, 4.3, 5.2, 5.4, 4.7, 3.5, 4.1, 5.6, 7.4, 6.9, 7.1, 7.9, 7.9, 7.5, 6.7, 7.7, 7.7, 7.4, 7.0, 7.1, 5.8, 5.9, 7.4, 8.199999999999999, 8.5, 9.4, 8.1, 10.9, 10.4, 10.9, 12.4, 12.1, 9.5, 7.5, 7.1, 7.5, 8.1, 6.8, 3.4, 2.1, 1.9, 2.8, 2.9, 1.3, 4.4, 4.2, 3.0, 3.0))->addSeries('Voll', array(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.3, 0.0, 0.0, 0.4, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 1.2, 1.7, 0.7, 2.9, 4.1, 2.6, 3.7, 3.9, 1.7, 2.3, 3.0, 3.3, 4.8, 5.0, 4.8, 5.0, 3.2, 2.0, 0.9, 0.4, 0.3, 0.5, 0.4));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 23
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "column"))->setTitle(array('text' => 'Total fruit consumtion, grouped by gender'))->setxAxis(array("categories" => array('Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas')))->setyAxis(array("min" => 0, "allowDecimals" => false, "title" => array("text" => "Number of fruits")))->setTooltip(array("formatter" => "function(){return '<b>'+ this.x +'</b><br/>'+this.series.name +': '+ this.y +'<br/>'+'Total: '+ this.point.stackTotal;}"))->setPlotOptions(array("column" => array("stacking" => "normal")))->addSeries('Jhon', array(5, 3, 4, 7, 2))->setSeriesOption('Jhon', 'stack', 'male')->addSeries('Joe', array(3, 4, 4, 2, 5))->setSeriesOption('Joe', 'stack', 'male')->addSeries('Jane', array(2, 2, 3, 2, 1))->setSeriesOption('Jane', 'stack', 'female')->addSeries('Janet', array(3, 0, 4, 4, 3))->setSeriesOption('Janet', 'stack', 'female');
echo $chart->renderChart('', true, 700, 350);
Esempio n. 24
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);
Esempio n. 25
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "areaspline"))->setTitle(array('text' => 'Average fruit consumption during one week'))->setLegend(array("layout" => 'vertical', "align" => 'right', "verticalAlign" => 'top', "x" => 150, "y" => 100, "floating" => true, "borderWidth" => 1, "backgroundColor" => '#FFFFFF'))->setxAxis(array("categories" => array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'), "plotBands" => array(array("from" => 4.5, "to" => 6.5, "color" => 'rgba(68, 170, 213, .2)'))))->setyAxis(array("title" => array("text" => 'Fruit units')))->setTooltip(array("formatter" => "function(){return this.x +': '+ this.y+' units';}"))->setPlotOptions(array("areaspline" => array("fillOpacity" => 0.5)))->addSeries('Jhon', array(3, 4, 3, 5, 4, 10, 12))->addSeries('Jane', array(1, 3, 4, 3, 3, 5, 4));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 26
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "column", "margin" => array(50, 50, 100, 80)))->setTitle(array('text' => "World's largest cities per 2008"))->setxAxis(array("categories" => array('Tokyo', 'Jakarta', 'New York', 'Seoul', 'Manila', 'Mumbai', 'Sao Paulo', 'Mexico City', 'Dehli', 'Osaka', 'Cairo', 'Kolkata', 'Los Angeles', 'Shanghai', 'Moscow', 'Beijing', 'Buenos Aires', 'Guangzhou', 'Shenzhen', 'Istanbul'), "labels" => array("rotation" => -45, "align" => "right", "style" => array("font" => "normal 13px Verdana, sans-serif"))))->setyAxis(array("min" => 0, "title" => array("text" => "Population (millions)")))->setLegend(array("enabled" => false))->setTooltip(array("formatter" => "function(){return '<b>'+ this.x +'</b><br/>'+'Population in 2008: '+ Highcharts.numberFormat(this.y, 1)+' millions';}"))->addSeries('Population', array(34.4, 21.8, 20.1, 20, 19.6, 19.5, 19.1, 18.4, 18, 17.3, 16.8, 15, 14.7, 14.5, 13.3, 12.8, 12.4, 11.8, 11.7, 11.2))->setSeriesOption('Population', array("dataLabels" => array("enabled" => true, "rotation" => -90, "color" => '#FFFFFF', "align" => 'right', "x" => -3, "y" => 10, "formatter" => "js:function() {return this.y;}", "style" => array("font" => 'normal 13px Verdana, sans-serif'))));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 27
0
require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
ini_set("display_errors", "1");
$data = array(array("y" => 55.11, "color" => "js:colors[0]", "drilldown" => array("name" => 'MSIE versions', "categories" => array('MSIE 6.0', 'MSIE 7.0', 'MSIE 8.0', 'MSIE 9.0'), "data" => array(10.85, 7.35, 33.06, 2.81), "color" => "js:colors[0]")), array("y" => 21.63, "color" => "js:colors[1]", "drilldown" => array("name" => 'Firefox versions', "categories" => array('Firefox 2.0', 'Firefox 3.0', 'Firefox 3.5', 'Firefox 3.6', 'Firefox 4.0'), "data" => array(0.2, 0.83, 1.58, 13.12, 5.43), "color" => "js:colors[1]")), array("y" => 11.94, "color" => "js:colors[2]", "drilldown" => array("name" => 'Chrome versions', "categories" => array('Chrome 5.0', 'Chrome 6.0', 'Chrome 7.0', 'Chrome 8.0', 'Chrome 9.0', 'Chrome 10.0', 'Chrome 11.0', 'Chrome 12.0'), "data" => array(0.12, 0.19, 0.12, 0.36, 0.32, 9.91, 0.5, 0.22), "color" => "js:colors[2]")), array("y" => 7.15, "color" => "js:colors[3]", "drilldown" => array("name" => 'Safari versions', "categories" => array('Safari 5.0', 'Safari 4.0', 'Safari Win 5.0', 'Safari 4.1', 'Safari/Maxthon', 'Safari 3.1', 'Safari 4.1'), "data" => array(4.55, 1.42, 0.23, 0.21, 0.2, 0.19, 0.14), "color" => "js:colors[3]")));
$sdata = jqGridUtils::encode($data);
$click = <<<CLICK
function(){
\tvar drilldown = this.drilldown; 
\tif (drilldown) { 
\t\tsetChart(drilldown.name, drilldown.categories, drilldown.data, drilldown.color);
\t} else {
\t\tsetChart(name, categories, {$sdata});
\t}
}
CLICK;
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "column"))->setTitle(array('text' => 'Browser market share, April, 2011'))->setSubtitle(array("text" => "Click the columns to view versions. Click again to view brands."))->setxAxis(array("categories" => array('MSIE', 'Firefox', 'Chrome', 'Safari', 'Opera')))->setyAxis(array("title" => array("text" => "Total percent market share")))->setTooltip(array("formatter" => "function(){var point = this.point, s = this.x +':<b>'+ this.y +'% market share</b><br/>'; if (point.drilldown) {s += 'Click to view '+ point.category +' versions';} else {s += 'Click to return to browser brands';} return s;}"))->setPlotOptions(array("column" => array("cursor" => 'pointer', "point" => array("events" => array("click" => "js:" . $click), "dataLabels" => array("enabled" => true, "color" => "js:Highcharts.getOptions().colors[0]", "style" => array("fontWeight" => 'bold'), "formatter" => "js:function(){return this.y +'%';}")))))->addSeries('Browser brands', $data);
$setser = <<<SETSER
function setChart(name, categories, data, color) {
\tchart.xAxis[0].setCategories(categories);
\tchart.series[0].remove();
\tchart.addSeries({
\t\tname: name,
\t\tdata: data,
\t\tcolor: color || 'white'
     });
}
SETSER;
$chart->setJSCode($setser);
echo $chart->renderChart('', true, 700, 350);
Esempio n. 28
0
<?php

require_once '../../../jq-config.php';
//require_once ABSPATH."php/jqUtils.php";
require_once ABSPATH . "php/jqGrid.php";
//require_once ABSPATH."php/jqGridArray.php";
//require_once ABSPATH."php/jqGridPdo.php";
require_once ABSPATH . "php/jqChart.php";
ini_set("display_errors", "1");
// get your data manually and build the array
$myconn = new PDO(DB_DSN, DB_USER, DB_PASSWORD);
$myconn->query("SET NAMES utf8");
$sth = $myconn->prepare("SELECT CustomerID, SUM(Freight) AS Freight FROM orders WHERE  (CustomerID ='BERGS' OR  CustomerID ='WHITC' ) AND OrderDate BETWEEN '1997-01-01' AND '1997-12-31' GROUP BY CustomerID");
$sth->execute();
$customers = $sth->fetchAll(PDO::FETCH_ASSOC);
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "bar"))->setTitle(array('text' => 'Freight  1997'))->setyAxis(array("title" => array("text" => "Freight")))->setJSCode("mychart = chart;")->setTooltip(array("formatter" => "function(){return '<b>'+ this.series.name +'</b><br/>'+this.x +': '+ this.y;}"))->addSeries($customers[0]['CustomerID'], array($customers[0]['Freight']))->addSeries($customers[1]['CustomerID'], array($customers[1]['Freight']));
echo $chart->renderChart('', true, 700, 350);
// building the grid
$grid = new jqGridRender(null);
$grid->setColModel(array(array("name" => "CustomerID", "key" => true), array("name" => "Freight")));
$grid->setUrl('grid.php');
$grid->setGridOptions(array("datatype" => "local", "data" => $customers));
$grid->navigator = false;
$grid->renderGrid('#grid', '#pager', true, null, null, false, false);
// Enjoy
Esempio n. 29
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->setChartOptions(array("defaultSeriesType" => "area"))->setTitle(array('text' => 'US and USSR nuclear stockpiles'))->setSubtitle(array("text" => 'Source: <a href="http://thebulletin.metapress.com/content/c4120650912x74k7/fulltext.pdf">thebulletin.metapress.com</a>'))->setxAxis(array("labels" => array("formatter" => "js:function(){return this.value;}")))->setyAxis(array("title" => array("text" => 'Nuclear weapon states'), "labels" => array("formatter" => "js:function(){return this.value/1000 +'k';}")))->setTooltip(array("formatter" => "function(){return this.series.name +' produced <b>'+Highcharts.numberFormat(this.y, 0) +'</b><br/>warheads in '+ this.x;}"))->setPlotOptions(array("area" => array("pointStart" => 1940, "marker" => array("enabled" => false, "symbol" => "circle", "radius" => 2, "states" => array("hover" => array("enabled" => true))))))->addSeries('USA', array(null, null, null, null, null, 6, 11, 32, 110, 235, 369, 640, 1005, 1436, 2063, 3057, 4618, 6444, 9822, 15468, 20434, 24126, 27387, 29459, 31056, 31982, 32040, 31233, 29224, 27342, 26662, 26956, 27912, 28999, 28965, 27826, 25579, 25722, 24826, 24605, 24304, 23464, 23708, 24099, 24357, 24237, 24401, 24344, 23586, 22380, 21004, 17287, 14747, 13076, 12555, 12144, 11009, 10950, 10871, 10824, 10577, 10527, 10475, 10421, 10358, 10295, 10104))->addSeries('USSR/Russia', array(null, null, null, null, null, null, null, null, null, null, 5, 25, 50, 120, 150, 200, 426, 660, 869, 1060, 1605, 2471, 3322, 4238, 5221, 6129, 7089, 8339, 9399, 10538, 11643, 13092, 14478, 15915, 17385, 19055, 21205, 23044, 25393, 27935, 30062, 32049, 33952, 35804, 37431, 39197, 45000, 43000, 41000, 39000, 37000, 35000, 33000, 31000, 29000, 27000, 25000, 24000, 23000, 22000, 21000, 20000, 19000, 18000, 18000, 17000, 16000));
echo $chart->renderChart('', true, 700, 350);
Esempio n. 30
0
<?php

require_once '../../../jq-config.php';
require_once ABSPATH . "php/jqUtils.php";
require_once ABSPATH . "php/jqChart.php";
$categories = array('0-4', '5-9', '10-14', '15-19', '20-24', '25-29', '30-34', '35-39', '40-44', '45-49', '50-54', '55-59', '60-64', '65-69', '70-74', '75-79', '80-84', '85-89', '90-94', '95-99', '100 +');
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "bar"))->setTitle(array('text' => 'Population pyramid for Germany, midyear 2010'))->setSubtitle("text", "Source: www.census.gov")->setxAxis(array(array("categories" => $categories, "reversed" => false), array("opposite" => true, "reversed" => false, "categories" => $categories, "linkedTo" => 0)))->setyAxis(array("min" => -4000000, "max" => 4000000, "title" => array("text" => null), "labels" => array("formatter" => "js:function(){return (Math.abs(this.value) / 1000000) + 'M';}")))->setLegend(array("backgroundColor" => '#FFFFFF', "reversed" => true))->setTooltip(array("formatter" => "function(){return '<b>'+ this.series.name +', age '+ this.point.category +'</b><br/>'+'Population: '+ Highcharts.numberFormat(Math.abs(this.point.y), 0);}"))->setPlotOptions(array("series" => array("stacking" => 'normal')))->addSeries('Male', array(-1746181, -1884428, -2089758, -2222362, -2537431, -2507081, -2443179, -2664537, -3556505, -3680231, -3143062, -2721122, -2229181, -2227768, -2176300, -1329968, -836804, -354784, -90569, -28367, -3878))->addSeries('Female', array(1656154, 1787564, 1981671, 2108575, 2403438, 2366003, 2301402, 2519874, 3360596, 3493473, 3050775, 2759560, 2304444, 2426504, 2568938, 1785638, 1447162, 1005011, 330870, 130632, 21208));
echo $chart->renderChart('', true, 700, 350);