Exemplo n.º 1
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$errorBars = new \Kendo\Dataviz\UI\ChartSeriesItemErrorBars();
$errorBars->value('stderr');
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->data(array(4.743, 7.295, 7.175, 6.376, 8.153, 8.535, 5.247, -7.832, 4.3, 4.3))->errorBars($errorBars);
$labelsPadding = new \Kendo\Dataviz\UI\ChartCategoryAxisItemLabelsPadding();
$labelsPadding->top(175);
$categoryAxisLabels = new \Kendo\Dataviz\UI\ChartCategoryAxisItemLabels();
$categoryAxisLabels->padding($labelsPadding);
$cateogrySeriesAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$cateogrySeriesAxis->line(array('visible' => false))->categories(array(2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011))->labels($categoryAxisLabels);
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('format' => '{0}%'))->line(array('visible' => false))->axisCrossingValue(0);
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->format('{0}%');
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Gross domestic product growth and standard error'))->legend(array('visible' => false))->addSeriesItem($series)->addValueAxisItem($valueAxis)->addCategoryAxisItem($cateogrySeriesAxis)->tooltip($tooltip)->seriesDefaults(array('type' => 'column'));
echo $chart->render();
?>

<?php 
require_once '../include/footer.php';
Exemplo n.º 2
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$india = new \Kendo\Dataviz\UI\ChartSeriesItem();
$india->name('India')->data(array(3.907, 7.943, 7.848, 9.284000000000001, 9.263, 9.801, 3.89, 8.238, 9.552, 6.855));
$world = new \Kendo\Dataviz\UI\ChartSeriesItem();
$world->name('World')->data(array(1.988, 2.733, 3.994, 3.464, 4.001, 3.939, 1.333, -2.245, 4.339, 2.727));
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('format' => '{0}%'))->line(array('visible' => false))->axisCrossingValue(0);
$labelsPadding = new \Kendo\Dataviz\UI\ChartCategoryAxisItemLabelsPadding();
$labelsPadding->top(80);
$categoryAxisLabels = new \Kendo\Dataviz\UI\ChartCategoryAxisItemLabels();
$categoryAxisLabels->padding($labelsPadding);
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->categories(array(2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011))->line(array('visible' => false))->labels($categoryAxisLabels);
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->format('{0}%')->template('#= series.name #: #= value #');
$errorBars = new \Kendo\Dataviz\UI\ChartSeriesItemErrorBars();
$errorBars->value('percentage(20)');
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Gross domestic product growth and percentage error'))->legend(array('visible' => false))->addSeriesItem($india, $world)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->tooltip($tooltip)->seriesDefaults(array('type' => 'line', 'errorBars' => $errorBars));
echo $chart->render();
require_once '../include/footer.php';
Exemplo n.º 3
0
<?php 
require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$errorBars = new \Kendo\Dataviz\UI\ChartSeriesItemErrorBars();
$errorBars->value('stddev');
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->data(array(7.943, 7.848, 9.284000000000001, 9.263, 9.801, 3.89, 8.238, 9.552))->errorBars($errorBars);
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('format' => '{0}%'))->line(array('visible' => false))->axisCrossingValue(0);
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->categories(array(2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010))->line(array('visible' => false));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->format('{0}%')->template('#= value # (σ = #= kendo.toString(high - low, "N2") #)');
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'GDP growth and standard deviation'))->legend(array('visible' => false))->addSeriesItem($series)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->tooltip($tooltip)->seriesDefaults(array('type' => 'area'));
echo $chart->render();
require_once '../include/footer.php';