コード例 #1
1
ファイル: smooth-radar-line.php プロジェクト: neevan1e/Done
<?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';
コード例 #2
0
ファイル: local-data-binding.php プロジェクト: neevan1e/Done
<?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';
コード例 #3
0
ファイル: remote-data-binding.php プロジェクト: neevan1e/Done
<?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';
コード例 #4
0
ファイル: local-data-binding.php プロジェクト: neevan1e/Done
<?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';
コード例 #5
0
ファイル: remote-data-binding.php プロジェクト: neevan1e/Done
<?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';
コード例 #6
0
ファイル: remote-data-binding.php プロジェクト: neevan1e/Done
<?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';
?>
<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>
コード例 #7
0
ファイル: remote-data-binding.php プロジェクト: neevan1e/Done
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';
?>
<div class="chart-wrapper" style="margin: auto;">
    <h3>1024x768 screen resolution trends</h3>
<?php 
for ($year = 2000; $year <= 2009; $year++) {
    $series = new \Kendo\Dataviz\UI\ChartSeriesItem();
    $series->field('share')->categoryField('resolution')->padding(0);
    $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'))->addFilterItem(array('field' => 'year', 'operator' => 'eq', 'value' => $year));
    $chart = new \Kendo\Dataviz\UI\Chart("chart{$year}");
    $chart->title(array('text' => "{$year}"))->dataSource($dataSource)->addSeriesItem($series)->legend(array('position' => 'top'))->tooltip(array('visible' => true, 'format' => 'N0', 'template' => "#= category # - #= kendo.format('{0:P}', percentage)#"))->seriesDefaults(array('type' => 'pie'));
    echo $chart->render();
}
?>
</div>
<style scoped>
    .chart-wrapper {
        text-align: center;
        height: 340px;
        width: 700px;
コード例 #8
0
ファイル: notes.php プロジェクト: neevan1e/Done
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
require_once '../include/header.php';
$wins = new \Kendo\Dataviz\UI\ChartSeriesItem();
$wins->field('win')->noteTextField('extremum')->notes(array('position' => 'bottom', 'label' => array('position' => 'outside')))->name('Wins');
$losses = new \Kendo\Dataviz\UI\ChartSeriesItem();
$losses->field('loss')->name('Losses');
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->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)->template('#= category # - #= value #%');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data(chart_grand_slam());
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Roger Federer Grand Slam tournament performance'))->dataSource($dataSource)->legend(array('position' => 'bottom'))->addSeriesItem($wins, $losses)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->seriesDefaults(array('type' => 'line'))->tooltip($tooltip);
echo $chart->render();
require_once '../include/footer.php';