Ejemplo n.º 1
1
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
    $result = chart_budget_report();
    echo json_encode($result);
    exit;
}
require_once '../include/header.php';
$budget = new \Kendo\Dataviz\UI\ChartSeriesItem();
$budget->field('budget');
$spending = new \Kendo\Dataviz\UI\ChartSeriesItem();
$spending->field('spending');
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->field('unit');
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('template' => '$#= value / 1000 #k'));
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(array('url' => 'remote-data-binding.php', 'type' => 'POST', 'dataType' => 'json'));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport);
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Budget report'))->dataSource($dataSource)->addSeriesItem($budget, $spending)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->seriesDefaults(array('type' => 'radarLine', 'style' => 'smooth'));
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 2
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$series2011 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series2011->name('2011')->data(array(array('category' => 'Asia', 'value' => 30.8, 'color' => '#9de219'), array('category' => 'Europe', 'value' => 21.1, 'color' => '#90cc38'), array('category' => 'Latin America', 'value' => 16.3, 'color' => '#068c35'), array('category' => 'Africa', 'value' => 17.6, 'color' => '#006634'), array('category' => 'Middle East', 'value' => 9.199999999999999, 'color' => '#004d38'), array('category' => 'North America', 'value' => 4.6, 'color' => '#033939')));
$series2012 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series2012->name('2012')->data(array(array('category' => 'Asia', 'value' => 53.8, 'color' => '#9de219'), array('category' => 'Europe', 'value' => 16.1, 'color' => '#90cc38'), array('category' => 'Latin America', 'value' => 11.3, 'color' => '#068c35'), array('category' => 'Africa', 'value' => 9.6, 'color' => '#006634'), array('category' => 'Middle East', 'value' => 5.2, 'color' => '#004d38'), array('category' => 'North America', 'value' => 3.6, 'color' => '#033939')))->labels(array('visible' => true, 'background' => 'transparent', 'position' => 'outsideEnd', 'template' => '#= category #: #= value#%'));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('position' => 'bottom', 'text' => 'Share of Internet Population Growth'))->addSeriesItem($series2011, $series2012)->legend(array('visible' => false))->tooltip(array('visible' => true, 'template' => '#= category # (#= series.name #): #= value #%'))->seriesDefaults(array('type' => 'donut', 'startAngle' => 150));
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 3
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$series2008 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series2008->name('January 2008')->data(array(array(16.4, 5.4), array(21.7, 2), array(25.4, 3), array(19, 2), array(10.9, 1), array(13.6, 3.2), array(10.9, 7.4), array(10.9, 0), array(10.9, 8.199999999999999), array(16.4, 0), array(16.4, 1.8), array(13.6, 0.3), array(13.6, 0), array(29.9, 0), array(27.1, 2.3), array(16.4, 0), array(13.6, 3.7), array(10.9, 5.2), array(16.4, 6.5), array(10.9, 0), array(24.5, 7.1), array(10.9, 0), array(8.1, 4.7), array(19, 0), array(21.7, 1.8), array(27.1, 0), array(24.5, 0), array(27.1, 0), array(29.9, 1.5), array(27.1, 0.8), array(22.1, 2)));
$series2009 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series2009->name('January 2009')->data(array(array(6.4, 13.4), array(1.7, 11), array(5.4, 8), array(9, 17), array(1.9, 4), array(3.6, 12.2), array(1.9, 14.4), array(1.9, 9), array(1.9, 13.2), array(1.4, 7), array(6.4, 8.800000000000001), array(3.6, 4.3), array(1.6, 10), array(9.9, 2), array(7.1, 15), array(1.4, 0), array(3.6, 13.7), array(1.9, 15.2), array(6.4, 16.5), array(0.9, 10), array(4.5, 17.1), array(10.9, 10), array(0.1, 14.7), array(9, 10), array(2.7, 11.8), array(2.1, 10), array(2.5, 10), array(27.1, 10), array(2.9, 11.5), array(7.1, 10.8), array(2.1, 12)));
$series2010 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series2010->name('January 2010')->data(array(array(21.7, 3), array(13.6, 3.5), array(13.6, 3), array(29.9, 3), array(21.7, 20), array(19, 2), array(10.9, 3), array(28, 4), array(27.1, 0.3), array(16.4, 4), array(13.6, 0), array(19, 5), array(16.4, 3), array(24.5, 3), array(32.6, 3), array(27.1, 4), array(13.6, 6), array(13.6, 8), array(13.6, 5), array(10.9, 4), array(16.4, 0), array(32.6, 10.3), array(21.7, 20.8), array(24.5, 0.8), array(16.4, 0), array(21.7, 6.9), array(13.6, 7.7), array(16.4, 0), array(8.1, 0), array(16.4, 0), array(16.4, 0)));
$xAxis = new \Kendo\Dataviz\UI\ChartXAxisItem();
$xAxis->max(35)->title(array('text' => 'Wind Speed [km/h]'))->crosshair(array('visible' => true, 'tooltip' => array('visible' => true, 'format' => 'n1')));
$yAxis = new \Kendo\Dataviz\UI\ChartYAxisItem();
$yAxis->min(-5)->max(25)->title(array('text' => 'Rainfall [mm]'))->axisCrossingValue(-5)->crosshair(array('visible' => true, 'tooltip' => array('visible' => true, 'format' => 'n1')));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Rainfall - Wind Speed'))->legend(array('position' => 'bottom'))->seriesDefaults(array('type' => 'scatter'))->addXAxisItem($xAxis)->addYAxisItem($yAxis)->addSeriesItem($series2008, $series2009, $series2010);
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 4
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$gold = new \Kendo\Dataviz\UI\ChartSeriesItem();
$gold->name('Gold Medals')->data(array(40, 32, 34, 36, 45, 33, 34, 83, 36, 37, 44, 37, 35, 36, 46))->color('#f3ac32');
$silver = new \Kendo\Dataviz\UI\ChartSeriesItem();
$silver->name('Silver Medals')->data(array(19, 25, 21, 26, 28, 31, 35, 60, 31, 34, 32, 24, 40, 38, 29))->color('#b8b8b8');
$bronze = new \Kendo\Dataviz\UI\ChartSeriesItem();
$bronze->name('Bronze Medals')->data(array(17, 17, 16, 28, 34, 30, 25, 30, 27, 37, 25, 33, 26, 36, 29))->color('#bb6e36');
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->categories(array(1952, 1956, 1960, 1964, 1968, 1972, 1976, 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012))->select(array('from' => 2, 'to' => 5))->majorGridLines(array('visible' => false));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Olympic Medals won by USA'))->legend(array('visible' => false))->addSeriesItem($gold, $silver, $bronze)->addCategoryAxisItem($categoryAxis)->selectStart('onSelectStart')->select('onSelect')->selectEnd('onSelectEnd');
echo $chart->render();
?>
<div class="configuration-horizontal">
    <span class="configHead">Mousewheel</span>
    <div class="config-section">
        <ul class="options">
            <li>
                <input id="reverse" type="checkbox" />
                <label for="reverse">Reverse</label>
            </li>
        </ul>
    </div>
    <div class="config-section">
        <ul class="options">
            <li>
                <label for="zoom">Zoom direction</label>
                <select id="zoom">
Ejemplo n.º 5
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$maxTemperature = new \Kendo\Dataviz\UI\ChartSeriesItem();
$maxTemperature->type('line')->data(array(6, 10, 10, 10, 10, 9, 5, 5, 10, 8, 8, 5, 8, 11, 9, 15, 20, 23, 24, 21, 21, 20, 22, 22, 20, 18, 16, 15, 20, 13.2, 18))->name('Max. Temperature [&deg;C]')->color('#ff1c1c')->axis('temp');
$minTemperature = new \Kendo\Dataviz\UI\ChartSeriesItem();
$minTemperature->type('line')->data(array(-5, -6, 0, -4, -3, -5.2, -5, -1.7, -1, 0, -0.4, -2, -2, -5, 4, -2, -4, -1, -1, 2, 4, -1, 1, 1, 4, 0, -1, 1, -2, 5.7, 5))->name('Min. Temperature [&deg;C]')->color('#ffae00')->axis('temp');
$windSpeed = new \Kendo\Dataviz\UI\ChartSeriesItem();
$windSpeed->type('area')->data(array(16.4, 21.7, 35.4, 19, 10.9, 13.6, 10.9, 10.9, 10.9, 16.4, 16.4, 13.6, 13.6, 29.9, 27.1, 16.4, 13.6, 10.9, 16.4, 10.9, 24.5, 10.9, 8.1, 19, 21.7, 27.1, 24.5, 16.4, 27.1, 29.9, 27.1))->name('Wind Speed [km/h]')->color('#73c100')->axis('wind');
$rainfall = new \Kendo\Dataviz\UI\ChartSeriesItem();
$rainfall->type('area')->data(array(5.4, 2, 5.4, 3, 2, 1, 3.2, 7.4, 0, 8.199999999999999, 0, 1.8, 0.3, 0, 0, 2.3, 0, 3.7, 5.2, 6.5, 0, 7.1, 0, 4.7, 0, 1.8, 0, 0, 0, 1.5, 0.8))->name('Rainfall [mm]')->color('#007eff')->axis('rain');
$rainValueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$rainValueAxis->name('rain')->color('#007eff')->min(0)->max(60);
$windValueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$windValueAxis->name('wind')->color('#73c100')->min(0)->max(60);
$tempValueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$tempValueAxis->name('temp')->min(-30)->max(30);
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->categories(array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'))->axisCrossingValue(array(32, 32, 0))->justified(true);
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->format('{0}')->template('#= category #/03: #= value #');
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'March Weather Report'))->legend(array('position' => 'bottom'))->addSeriesItem($maxTemperature, $minTemperature, $windSpeed, $rainfall)->addValueAxisItem($rainValueAxis, $windValueAxis, $tempValueAxis)->addCategoryAxisItem($categoryAxis)->tooltip($tooltip)->seriesDefaults(array('type' => 'line'));
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 6
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$total = new \Kendo\Dataviz\UI\ChartSeriesItem();
$total->name('Total Visits')->data(array(56000, 63000, 74000, 91000, 117000, 138000));
$unique = new \Kendo\Dataviz\UI\ChartSeriesItem();
$unique->name('Unique visitors')->data(array(52000, 34000, 23000, 48000, 67000, 83000));
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->line(array('visible' => false));
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->categories(array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'))->majorGridLines(array('visible' => false));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->template('#= series.name #: #= value #');
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->addSeriesItem($total, $unique)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->legend(array('position' => 'bottom'))->seriesDefaults(array('type' => 'column'))->chartArea(array('background' => 'transparent'))->title(array('text' => 'Site Visitors Stats /thousands/'))->tooltip($tooltip);
echo $chart->render();
?>
<div class="configuration-horizontal">
    <div class="config-section">
        <span class="configHead">Gap</span>
        <ul class="options">
            <li>
                <input id="gap" type="number" value="1.5" step="0.1" style="width: 60px;" />
                <button id="getGap" class="k-button">Set gap</button
            </li>
        </ul>
    </div>
    <div class="config-section">
        <span class="configHead">Spacing</span>
        <ul class="options">
Ejemplo n.º 7
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->field('value')->name('United States');
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('format' => '{0}%'))->line(array('visible' => false));
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->field('year')->majorGridLines(array('visible' => false));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->format('{0}%')->template('#= category # - #= value #%');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data(chart_united_states_internet_usage());
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Internet Users in United States'))->dataSource($dataSource)->legend(array('visible' => false))->addSeriesItem($series)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->seriesDefaults(array('type' => 'area', 'labels' => array('visible' => true, 'format' => '{0}%', 'background' => 'transparent')))->tooltip($tooltip);
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 8
0
require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
    $result = chart_spain_electricity_production();
    echo json_encode($result);
    exit;
}
require_once '../include/header.php';
?>
<div class="chart-wrapper" style="margin: auto;">
<?php 
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->field('wind')->categoryField('year')->segmentSpacing(2);
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(array('url' => 'remote-data-binding.php', 'type' => 'POST', 'dataType' => 'json'));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->addSortItem(array('field' => 'year', 'dir' => 'desc'));
$chart = new \Kendo\Dataviz\UI\Chart("chart");
$chart->title(array('text' => "Spain windpower electricity production (GWh)"))->dataSource($dataSource)->addSeriesItem($series)->legend(array('visible' => false))->tooltip(array('visible' => true, 'format' => 'N0', 'template' => "#= dataItem.year # - #= value# GWh"))->seriesDefaults(array('type' => 'funnel', 'dynamicSlope' => true, 'dynamicHeight' => false, 'labels' => array('visible' => true, 'template' => '#= dataItem.year#')));
echo $chart->render();
?>
</div>
<style scoped>
    .chart-wrapper .k-chart {
        margin: 0 auto;
        width: 400px;
    }
</style>
<?php 
require_once '../include/footer.php';
Ejemplo n.º 9
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->type('funnel')->data(array(array('category' => 'Awareness', 'value' => 4), array('category' => 'Interest', 'value' => 3), array('category' => 'Desire', 'value' => 2), array('category' => 'Action', 'value' => 1)));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'The AIDA model'))->addSeriesItem($series)->legend(array('position' => 'top'))->tooltip(array('visible' => true, 'template' => "#= category # - #= kendo.format('{0:P}', percentage) #"))->seriesDefaults(array("dynamicHeight" => false, "labels" => array("template" => "#= dataItem.category #", "visible" => true, "font" => "15px sans-serif", "align" => "center", "position" => "center", "background" => "transparent", "color" => "#000", "padding" => 5, "border" => array("width" => 1, "dashType" => "dot", "color" => "#000"), "format" => "N0")));
?>

    <div class="chart-wrapper">
        <?php 
echo $chart->render();
?>
    </div>
    <div class="configuration-horizontal">
        <div class="config-section">
            <span class="configHead">Show</span>
            <ul class="options">
                <li>
                    <label>
                        <input id="labels" checked="checked" type="checkbox" autocomplete="off" /> Show labels
                    </label>
                </li>
                <li>
                    <label>
                        <input id="showBorder" type="checkbox" checked="checked" /> Show border
                    </label>
                </li>
            </ul>
        </div>
Ejemplo n.º 10
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->type('donut')->field('percentage')->categoryField('source')->explodeField('explode');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data(array(array('source' => 'Hydro', 'percentage' => 22, 'explode' => true), array('source' => 'Solar', 'percentage' => 2), array('source' => 'Nuclear', 'percentage' => 49), array('source' => 'Wind', 'percentage' => 27)));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Break-up of Spain Electricity Production for 2008'))->dataSource($dataSource)->addSeriesItem($series)->legend(array('position' => 'bottom'))->seriesColors(array('#42a7ff', '#666666', '#999999', '#cccccc'))->tooltip(array('visible' => true, 'template' => '${ category } - ${ value }%'));
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 11
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$polar1 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$polar1->data(array(array(0, 0), array(15, 2), array(30, 4), array(45, 6), array(60, 8), array(75, 10), array(90, 12), array(105, 14), array(120, 16), array(135, 18), array(150, 20), array(165, 22), array(180, 24), array(195, 26), array(210, 28), array(225, 30), array(240, 32), array(255, 34), array(270, 36), array(285, 38), array(300, 40), array(315, 42), array(330, 44), array(345, 46), array(360, 48), array(15, 50), array(30, 52), array(45, 54), array(60, 56), array(75, 58), array(90, 60)));
$polar2 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$polar2->data(array(array(0, 0), array(15, 1), array(30, 2), array(45, 3), array(60, 4), array(75, 5), array(90, 6), array(105, 7), array(120, 8), array(135, 9), array(150, 10), array(165, 11), array(180, 12), array(195, 13), array(210, 14), array(225, 15), array(240, 16), array(255, 17), array(270, 18), array(285, 19), array(300, 20), array(315, 21), array(330, 22), array(345, 23), array(360, 24), array(15, 25), array(30, 26), array(45, 27), array(60, 28), array(75, 29), array(90, 30)));
$polar3 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$polar3->data(array(array(0, 0), array(15, 3), array(30, 6), array(45, 9), array(60, 12), array(75, 15), array(90, 18), array(105, 21), array(120, 24), array(135, 27), array(150, 30), array(165, 33), array(180, 36), array(195, 39), array(210, 42), array(225, 45), array(240, 48), array(255, 51), array(270, 54), array(285, 57), array(300, 60), array(315, 63), array(330, 66), array(345, 69), array(360, 72), array(15, 75), array(30, 78), array(45, 81), array(60, 84), array(75, 87), array(90, 90)));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Polar plot'))->addSeriesItem($polar1, $polar2, $polar3)->seriesDefaults(array('type' => 'polarLine', 'style' => 'smooth'));
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 12
0
$female2039 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$female2039->name('20-39')->stack('Female')->data(array(490550, 555695, 627763, 718568, 810169, 883051, 942151, 1001395, 1058439));
$female4064 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$female4064->name('40-64')->stack('Female')->data(array(379788, 411217, 447201, 484739, 395533, 435485, 499861, 569114, 655066));
$female6579 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$female6579->name('65-79')->stack('Female')->data(array(97894, 113287, 128808, 137459, 152171, 170262, 191015, 210767, 226956));
$female80 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$female80->name('80+')->stack('Female')->data(array(16358, 18576, 24586, 30352, 36724, 42939, 46413, 54984, 66029));
$male019 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$male019->name('0-19')->stack('Male')->data(array(900268, 972205, 1031421, 1094547, 1155600, 1202766, 1244870, 1263637, 1268165));
$male2039 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$male2039->name('20-39')->stack('Male')->data(array(509133, 579487, 655494, 749511, 844496, 916479, 973694, 1036548, 1099507));
$male4064 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$male4064->name('40-64')->stack('Male')->data(array(364179, 401396, 440844, 479798, 390590, 430666, 495030, 564169, 646563));
$male6579 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$male6579->name('65-79')->stack('Male')->data(array(74208, 86516, 98956, 107352, 120614, 138868, 158387, 177078, 192156));
$male80 = new \Kendo\Dataviz\UI\ChartSeriesItem();
$male80->name('80+')->stack('Male')->data(array(9187, 10752, 13007, 15983, 19442, 23020, 25868, 31462, 39223));
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('template' => "#= kendo.format('{0:N0}', value / 1000) # M"))->line(array('visible' => false));
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->categories(array(1970, 1975, 1980, 1985, 1990, 1995, 2000, 2005, 2010))->majorGridLines(array('visible' => false));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->template('#= series.stack #s, age #= series.name #');
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'World population by age group and sex'))->legend(array('visible' => false))->addSeriesItem($female019, $female2039, $female4064, $female6579, $female80, $male019, $male2039, $male4064, $male6579, $male80)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->tooltip($tooltip)->seriesColors(array('#cd1533', '#d43851', '#dc5c71', '#e47f8f', '#eba1ad', '#009bd7', '#26aadd', '#4db9e3', '#73c8e9', '#99d7ef'))->seriesDefaults(array('type' => 'column'));
echo $chart->render();
?>

<?php 
require_once '../include/footer.php';
Ejemplo n.º 13
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->type('pie')->data(array(array('category' => 'Football', 'value' => 35), array('category' => 'Basketball', 'value' => 25), array('category' => 'Volleyball', 'value' => 20), array('category' => 'Rugby', 'value' => 10), array('category' => 'Tennis', 'value' => 10)));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'What is you favourite sport?'))->addSeriesItem($series)->legend(array('position' => 'top'))->tooltip(array('visible' => true, 'template' => "#= category # - #= kendo.format('{0:P}', percentage) #"))->seriesDefaults(array('labels' => array('template' => "#= category # - #= kendo.format('{0:P}', percentage)#", 'position' => 'outsideEnd', 'visible' => true, 'background' => 'transparent')));
echo $chart->render();
?>
<div class="configuration-horizontal">
    <div class="config-section">
        <span class="configHead">Labels Configuration</span>
        <ul class="options">
            <li>
                <input id="labels" checked="checked" type="checkbox" autocomplete="off" />
                <label for="labels">Show labels</label>
            </li>
            <li>
                <input id="alignCircle" name="alignType" type="radio"
                       value="circle" checked="checked" autocomplete="off" />
                <label for="alignCircle">Aligned in circle</label>
            </li>
            <li>
                <input id="alignColumn" name="alignType" type="radio"
                       value="column" autocomplete="off" />
                <label for="alignColumn">Aligned in columns</label>
            </li>
        </ul>
    </div>
</div>
Ejemplo n.º 14
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->type('boxPlot')->lowerField('lower')->q1Field('q1')->medianField('median')->q3Field('q3')->upperField('upper')->meanField('mean')->outliersField('outliers');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data(ozone_oncentration());
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->field('year')->majorGridLines(array('visible' => false));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Ozone Concentration (ppm)'))->legend(array('visible' => false))->dataSource($dataSource)->addSeriesItem($series)->addCategoryAxisItem($categoryAxis);
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 15
0
    $result = chart_april_sales();
    echo json_encode($result);
    exit;
}
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->type('verticalBullet')->currentField('current')->targetField('target')->gap(4)->target(array('color' => '#aaaaaa'));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->shared(true)->template('Target: #= value.target # items<br /> Actual: #= value.current # items');
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(array('url' => 'remote-data-binding.php', 'type' => 'POST', 'dataType' => 'json'));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport);
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->min(2000)->max(11000)->majorGridLines(array('visible' => false))->minorTicks(array('' => true))->addPlotBand(array('from' => 1000, 'to' => 3000, 'color' => '#aaaaaa', 'opacity' => 0.55), array('from' => 3000, 'to' => 5000, 'color' => '#aaaaaa', 'opacity' => 0.4), array('from' => 5000, 'to' => 8000, 'color' => '#aaaaaa', 'opacity' => 0.25), array('from' => 8000, 'to' => 11000, 'color' => '#aaaaaa', 'opacity' => 0.1));
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->majorGridLines(array('visible' => false))->field('category');
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->dataSource($dataSource)->legend(array('visible' => false))->addSeriesItem($series)->addCategoryAxisItem($categoryAxis)->addValueAxisItem($valueAxis)->tooltip($tooltip);
echo $chart->render();
?>
<style>
    .chart-wrapper {
        padding-top: 20px;
    }
    .chart-wrapper .k-tooltip {
        text-align: left;
    }
</style>
<?php 
require_once '../include/footer.php';
Ejemplo n.º 16
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));
$russia = new \Kendo\Dataviz\UI\ChartSeriesItem();
$russia->name('World')->data(array(4.743, 7.295, 7.175, 6.376, 8.153, 8.535, 5.247, -7.832, 4.3, 4.3));
$haiti = new \Kendo\Dataviz\UI\ChartSeriesItem();
$haiti->name('Haiti')->data(array(-0.253, 0.362, -3.519, 1.799, 2.252, 3.343, 0.843, 2.877, -5.416, 5.59));
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('format' => '{0}%'))->line(array('visible' => false))->axisCrossingValue(-10);
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->categories(array(2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011))->majorGridLines(array('visible' => false));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->format('{0}%')->template('#= series.name #: #= value #');
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Gross domestic product growth /GDP annual %/'))->legend(array('position' => 'bottom'))->addSeriesItem($india, $world, $russia, $haiti)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->tooltip($tooltip)->chartArea(array('background' => 'transparent'))->seriesDefaults(array('type' => 'line', 'style' => 'smooth'));
echo $chart->render();
?>

<style type="text/css">
    #chart {
        background: center no-repeat url('../content/shared/styles/world-map.png');
    }
</style>
<?php 
require_once '../include/footer.php';
Ejemplo n.º 17
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$signal = new \Kendo\Dataviz\UI\ChartSeriesItem();
$signal->type('area')->data(array(20, 1, 18, 3, 15, 5, 10, 6, 9, 6, 10, 5, 13, 3, 16, 1, 19, 1, 20, 2, 18, 5, 12, 7, 10, 8))->line(array('style' => 'smooth'));
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->title(array('text' => 'time'))->majorGridLines(array('visible' => false))->majorTicks(array('visible' => false));
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->max(22)->title(array('text' => 'voltage'))->majorGridLines(array('visible' => false))->visible(false);
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'A digital signal'))->legend(array('visible' => false))->addSeriesItem($signal)->addCategoryAxisItem($categoryAxis)->addValueAxisItem($valueAxis);
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 18
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$gold = new \Kendo\Dataviz\UI\ChartSeriesItem();
$gold->name('Gold Medals')->data(array(40, 32, 34, 36, 45, 33, 34, 83, 36, 37, 44, 37, 35, 36, 46))->color('#f3ac32');
$silver = new \Kendo\Dataviz\UI\ChartSeriesItem();
$silver->name('Silver Medals')->data(array(19, 25, 21, 26, 28, 31, 35, 60, 31, 34, 32, 24, 40, 38, 29))->color('#b8b8b8');
$bronze = new \Kendo\Dataviz\UI\ChartSeriesItem();
$bronze->name('Bronze Medals')->data(array(17, 17, 16, 28, 34, 30, 25, 30, 27, 37, 25, 33, 26, 36, 29))->color('#bb6e36');
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->line(array('visible' => false))->majorGridLines(array('visible' => true));
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->categories(array(1952, 1956, 1960, 1964, 1968, 1972, 1976, 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012))->majorGridLines(array('visible' => false));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->template('#= series.name #: #= value #');
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Olympic Medals won by USA'))->legend(array('visible' => false))->addSeriesItem($gold, $silver, $bronze)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->tooltip($tooltip)->seriesDefaults(array('type' => 'bar', 'stack' => array('type' => '100%')));
echo $chart->render();
?>

<?php 
require_once '../include/footer.php';
Ejemplo n.º 19
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
    $result = chart_spain_electricity_production();
    echo json_encode($result);
    exit;
}
require_once '../include/header.php';
$nuclear = new \Kendo\Dataviz\UI\ChartSeriesItem();
$nuclear->field('nuclear')->name('Nuclear');
$hydro = new \Kendo\Dataviz\UI\ChartSeriesItem();
$hydro->field('hydro')->name('Hydro');
$wind = new \Kendo\Dataviz\UI\ChartSeriesItem();
$wind->field('wind')->name('Wind');
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('format' => 'N0'))->line(array('visible' => false))->majorUnit(10000);
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->field('year')->labels(array('rotation' => -90))->crosshair(array('visible' => true));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->format('N0')->shared(true);
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(array('url' => 'remote-data-binding.php', 'type' => 'POST', 'dataType' => 'json'));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->addSortItem(array('field' => 'year', 'dir' => 'asc'));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Spain electricity production (GWh)'))->dataSource($dataSource)->legend(array('position' => 'top'))->addSeriesItem($nuclear, $hydro, $wind)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->seriesDefaults(array('type' => 'line'))->tooltip($tooltip);
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 20
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$series08c = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series08c->name('0.8C')->data(array(array(10, 10), array(15, 20), array(20, 25), array(32, 15), array(43, 50), array(55, 30), array(60, 70), array(70, 50), array(90, 100)));
$series16c = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series16c->name('1.6C')->data(array(array(10, 40), array(17, 50), array(22, 70), array(35, 60), array(47, 95), array(60, 100)));
$series31c = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series31c->name('1.6C')->data(array(array(10, 70), array(13, 90), array(25, 100)));
$xAxis = new \Kendo\Dataviz\UI\ChartXAxisItem();
$xAxis->max(90)->labels(array('format' => '{0}m'))->title(array('text' => 'Time'));
$yAxis = new \Kendo\Dataviz\UI\ChartYAxisItem();
$yAxis->max(100)->labels(array('format' => '{0}%'))->title(array('text' => 'Charge'));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Charge current vs. charge time'))->legend(array('visible' => true))->seriesDefaults(array('type' => 'scatterLine', 'style' => 'smooth'))->addXAxisItem($xAxis)->addYAxisItem($yAxis)->addSeriesItem($series08c, $series16c, $series31c)->tooltip(array('visible' => true, 'format' => '{1}% in {0} minutes'));
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 21
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
    $result = chart_screen_resolution();
    echo json_encode($result);
    exit;
}
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->field('share')->categoryField('resolution')->visibleInLegendField('visibleInLegend')->padding(10);
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(array('url' => 'remote-data-binding.php', 'type' => 'POST', 'dataType' => 'json'));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->addSortItem(array('field' => 'order', 'dir' => 'asc'))->addGroupItem(array('field' => 'year'));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => '1024x768 screen resolution trends'))->dataSource($dataSource)->addSeriesItem($series)->legend(array('position' => 'top'))->tooltip(array('visible' => true, 'template' => '#= dataItem.resolution #: #= value #% (#= dataItem.year #)'))->seriesDefaults(array('type' => 'donut', 'startAngle' => 270));
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 22
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$battery = new \Kendo\Dataviz\UI\ChartSeriesItem();
$battery->type('column')->data(array(20, 40, 45, 30, 50))->stack(true)->name('on battery')->color('#cc6e38');
$gas = new \Kendo\Dataviz\UI\ChartSeriesItem();
$gas->type('column')->data(array(20, 30, 35, 35, 40))->stack(true)->name('on gas')->color('#ef955f');
$mpg = new \Kendo\Dataviz\UI\ChartSeriesItem();
$mpg->type('line')->data(array(30, 38, 40, 32, 42))->name('mpg')->color('#ec5e0a')->axis('mpg');
$l100km = new \Kendo\Dataviz\UI\ChartSeriesItem();
$l100km->type('line')->data(array(7.8, 6.2, 5.9, 7.4, 5.6))->name('l/100 km')->color('#4e4141')->axis('l100km');
$milesAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$milesAxis->title(array('text' => 'miles'))->min(0)->max(100);
$kmAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$kmAxis->name('km')->title(array('text' => 'km'))->min(0)->max(161)->majorUnit(32);
$mpgAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$mpgAxis->name('mpg')->title(array('text' => 'miles per gallo'))->color('#642381');
$l100kmAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$l100kmAxis->name('l100km')->title(array('text' => 'liters per 100km'))->color('#e5388a');
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->categories(array('Mon', 'Tue', 'Wed', 'Thu', 'Fri'))->axisCrossingValue(array(0, 0, 10, 10));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Hybrid car mileage report'))->legend(array('position' => 'top'))->addSeriesItem($battery, $gas, $mpg, $l100km)->addValueAxisItem($milesAxis, $kmAxis, $mpgAxis, $l100kmAxis)->addCategoryAxisItem($categoryAxis);
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 23
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->field('value')->colorField('userColor');
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->max(28)->majorGridLines(array('visible' => false))->visible(false);
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->field('day')->majorGridLines(array('visible' => false))->line(array('visible' => false));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->format('{0}%')->template('#= category # - #= value #%');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data(chart_blog_comments());
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('align' => 'left', 'text' => 'Comments per day'))->dataSource($dataSource)->legend(array('visible' => false))->addSeriesItem($series)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->seriesDefaults(array('type' => 'column', 'labels' => array('visible' => true, 'background' => 'transparent')))->tooltip($tooltip);
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 24
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
require_once '../include/header.php';
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data(chart_sun_position());
$position = new \Kendo\Dataviz\UI\ChartSeriesItem();
$position->type('polarLine')->xField('azimuth')->yField('altitude')->labels(array('template' => '#= dataItem.time.substring(0,2) #h', 'position' => 'below', 'visible' => true));
$xAxis = new \Kendo\Dataviz\UI\ChartXAxisItem();
$xAxis->startAngle(-90)->majorUnit(30);
$yAxis = new \Kendo\Dataviz\UI\ChartYAxisItem();
$yAxis->labels(array('visible' => false));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Sun position at equinox'))->dataSource($dataSource)->addSeriesItem($position)->addXAxisItem($xAxis)->addYAxisItem($yAxis);
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 25
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
    $result = chart_stock_prices();
    echo json_encode($result);
    exit;
}
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->type('line')->field('close')->name('#= group.value # (close)');
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('format' => '${0}', 'skip' => 2, 'step' => 2));
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->field('date')->labels(array('format' => 'MMM'));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->format('{0}%')->template('#= series.name # - #= value #%');
$model = new \Kendo\Data\DataSourceSchemaModel();
$model->addField(array('field' => 'date', 'type' => 'date'));
$schema = new \Kendo\Data\DataSourceSchema();
$schema->model($model);
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(array('url' => 'grouped-data.php', 'type' => 'POST', 'dataType' => 'json'));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->schema($schema)->addGroupItem(array('field' => 'symbol'))->addSortItem(array('field' => 'date', 'dir' => 'asc'));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Stock Prices'))->dataSource($dataSource)->legend(array('position' => 'bottom'))->addSeriesItem($series)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->seriesDefaults(array('type' => 'area'))->tooltip($tooltip);
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 26
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->type('column')->aggregate('avg')->field('value')->categoryField('date');
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->type('date')->baseUnit("weeks");
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data(chart_date_points());
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->dataSource($dataSource)->addSeriesItem($series)->addCategoryAxisItem($categoryAxis);
echo $chart->render();
?>
<div class="configuration-horizontal">
    <div class="config-section">
        <span class="configHead">Base date unit</span>
        <ul class="options">
            <li>
                <input id="baseUnitAuto" name="baseUnit"
                        type="radio" value="" autocomplete="off" />
                <label for="baseUnitAuto">Automatic (default)</label>
            </li>
            <li>
                <input id="baseUnitYears" name="baseUnit"
                        type="radio" value="years" autocomplete="off" />
                <label for="baseUnitYears">Years</label>
            </li>
            <li>
                <input id="baseUnitMonths" name="baseUnit"
Ejemplo n.º 27
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
    $result = chart_antenna_gain();
    echo json_encode($result);
    exit;
}
require_once '../include/header.php';
$gain = new \Kendo\Dataviz\UI\ChartSeriesItem();
$gain->type('polarLine')->xField('azimuth')->yField('gain');
$xAxis = new \Kendo\Dataviz\UI\ChartXAxisItem();
$xAxis->majorUnit(30);
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(array('url' => 'remote-data-binding.php', 'type' => 'POST', 'dataType' => 'json'));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport);
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Antenna Gain (dB)'))->dataSource($dataSource)->addSeriesItem($gain)->addXAxisItem($xAxis);
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 28
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$andrew = new \Kendo\Dataviz\UI\ChartSeriesItem();
$andrew->name('Andrew Dodsworth')->data(array(10, 3, 3, 10, 2, 10));
$margaret = new \Kendo\Dataviz\UI\ChartSeriesItem();
$margaret->name('Margaret Peacock')->data(array(9, 7, 7, 9, 6, 7));
$nancy = new \Kendo\Dataviz\UI\ChartSeriesItem();
$nancy->name('Nancy Callahan')->data(array(4, 10, 10, 5, 5, 4));
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->categories(array("Experience", "Communication", "Friendliness", "Subject knowledge", "Presentation", "Education"))->majorGridLines(array('visible' => false));
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('format' => '{0}%'))->line(array('visible' => false));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Employment candidate review'))->legend(array('position' => 'bottom'))->seriesDefaults(array('type' => 'radarArea'))->addSeriesItem($andrew, $margaret, $nancy)->addCategoryAxisItem($categoryAxis)->addValueAxisItem($valueAxis);
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 29
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->xField('price')->yField('performance');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data(chart_price_performance());
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Price-Performance Ratio'))->dataSource($dataSource)->addSeriesItem($series)->tooltip(array('visible' => true, 'template' => "#= '<b>\$' + value.x + ' / ' + dataItem.family + ' ' + dataItem.model + ': ' + value.y + '%</b>' #"))->addXAxisItem(array('max' => 1000, 'labels' => array('format' => '${0}'), 'title' => array('text' => 'Price')))->addYAxisItem(array('min' => 80, 'labels' => array('format' => '{0}%'), 'title' => array('text' => 'Performance Ratio')))->legend(array('visible' => false))->seriesDefaults(array('type' => 'scatter'));
echo $chart->render();
require_once '../include/footer.php';
Ejemplo n.º 30
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$data = array(1, 1);
for ($i = 2; $i < 39; $i++) {
    $data[] = $data[$i - 1] + $data[$i - 2];
}
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->data($data);
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->type('log')->minorGridLines(array('visible' => true));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true);
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->addSeriesItem($series)->addValueAxisItem($valueAxis)->title(array('text' => 'Fibonacci sequence'))->tooltip($tooltip);
echo $chart->render();
?>


<?php 
require_once '../include/footer.php';