当前位置: 首页>>代码示例>>PHP>>正文


PHP Dashboard::addComponent方法代码示例

本文整理汇总了PHP中Dashboard::addComponent方法的典型用法代码示例。如果您正苦于以下问题:PHP Dashboard::addComponent方法的具体用法?PHP Dashboard::addComponent怎么用?PHP Dashboard::addComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dashboard的用法示例。


在下文中一共展示了Dashboard::addComponent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: MySQLDataSource

<?php

require_once "rf/razorflow.php";
require_once "models/config.php";
if (!securePage($_SERVER['PHP_SELF'])) {
    die;
}
require_once "models/header.php";
//Left Nav bar
echo "\r\n<body>\r\n<div id='wrapper'>\r\n<div id='top'><div id='logo'></div></div>\r\n<div id='content'>\r\n\r\n<div id='left-nav'>";
include "left-nav.php";
//Main Content
echo "\r\n</div>\r\n<div id='main'>\r\n";
$dataSource = new MySQLDataSource('2013teamb', '2013teamb', '29G8l!06J82ofpPw', 'devdb.fulgentcorp.com');
$dataSource->setSQLSource('Item');
// Create a chart to show aggregated sales by genre
$itemPriority = new ChartComponent();
$itemPriority->setCaption("Item Priority");
$itemPriority->setDataSource($dataSource);
$itemPriority->setLabelExpression("Name", "Item.ItemName");
$itemPriority->addSeries("Priority", "Item.Priority");
$itemPriority->setOption('limit', 10);
Dashboard::addComponent($itemPriority);
Dashboard::Render();
echo "\r\n</div>\r\n\r\n\r\n<div id='bottom'></div>\r\n</div>\r\n</body>\r\n</html>";
开发者ID:KeyMaker13,项目名称:scrum,代码行数:25,代码来源:test_item_.php

示例2: mysqli_query

$project = mysqli_query($connection, "SELECT * FROM " . "Project WHERE ProjectName = '{$token}'");
$projectInfo = mysqli_fetch_array($project);
$ProjectID = $projectInfo['ProjectID'];
$ProjectName = $projectInfo['ProjectName'];
$DateCreated = $projectInfo['DateCreated'];
$DateCompleted = $projectInfo['DateCompleted'];
$Creator = $projectInfo['Creator'];
$CurrentSprint = $projectInfo['CurrentSprint'];
$SprintDuration = $projectInfo['SprintDuration'];
$dataSource = new MySQLDataSource('2013teamb', '2013teamb', '29G8l!06J82ofpPw', 'devdb.fulgentcorp.com');
$dataSource->setSQLSource("Sprint");
$sprintRange = new ChartComponent();
$sprintRange->setCaption("Sprint Metrics");
$sprintRange->setDataSource($dataSource);
$sprintRange->addCondition("Sprint.ProjectID", "==", "{$ProjectID}");
//$sprintRange->setLabelExpression("Sprint", "Sprint.SprintNum");
$sprintRange->setLabelExpression("Day", "Sprint.FinishTime", array('timestampRange' => 'time', 'timeUnit' => 'day', 'customTimeUnitPath' => array('year', 'month', 'day'), 'autoDrill' => true));
//$sprintRange->setYAxis("Day");
$sprintRange->addSeries("Day", "SprintNum");
//$sprintRange->setOption('limit', 10);
Dashboard::addComponent($sprintRange);
$itemSource = new MySQLDataSource('2013teamb', '2013teamb', '29G8l!06J82ofpPw', 'devdb.fulgentcorp.com');
$itemSource->setSQLSource("Item");
$itemRange = new ChartComponent();
$itemRange->setCaption("Item Metrics");
$itemRange->setDataSource($itemSource);
$itemRange->addCondition("Item.ProjectID", "==", "{$ProjectID}");
$itemRange->setLabelExpression("Name", "Item.ItemName");
$itemRange->addSeries("Item", "Item.Priority");
Dashboard::addComponent($itemRange);
Dashboard::Render();
开发者ID:KeyMaker13,项目名称:scrum,代码行数:31,代码来源:test_item.php

示例3: TableComponent

$saleTable = new TableComponent();
$saleTable->setCaption("Sales Table");
$saleTable->setWidth(3);
$saleTable->setDataSource($dataSource);
$saleTable->addColumn("Track", "track.Name");
$saleTable->addColumn("Album", "album.Title");
$saleTable->addColumn("Sale Date", "invoice.InvoiceDate", array('width' => 50));
$saleTable->addColumn("Amount", "track.UnitPrice * invoiceLine.Quantity", array('width' => 50, 'textAlign' => 'right', 'numberPrefix' => '$'));
Dashboard::addComponent($saleTable);
// Link the artist chart to the sales table
$artistSales->autoLink($saleTable);
// Create a Key Performance Indicators to measure the total sales last month
$saleKPI = new KPIComponent();
$saleKPI->setCaption("Last Month's sales");
$saleKPI->setDataSource($dataSource);
$saleKPI->setValueExpression("track.UnitPrice * invoiceLine.Quantity", array('aggregate' => true, 'aggregateFunction' => "SUM", 'numberPrefix' => '$'));
$saleKPI->setTimestampExpression("invoice.InvoiceDate", array('timeUnit' => 'month'));
Dashboard::addComponent($saleKPI);
// Link the artist chart to sales KPI
$artistSales->autoLink($saleKPI);
$yearlySalesGauge = new GaugeComponent();
$yearlySalesGauge->setCaption("This Year's sales");
$yearlySalesGauge->setPlaceholder("Please select an artist");
$yearlySalesGauge->setDataSource($dataSource);
$yearlySalesGauge->setValueExpression("invoiceLine.Quantity", array('aggregate' => true, 'aggregateFunction' => "SUM"));
$yearlySalesGauge->setTimestampExpression("invoice.InvoiceDate", array('timeUnit' => 'year'));
$yearlySalesGauge->setKeyPoints(array(5, 10, 20, 30));
Dashboard::addComponent($yearlySalesGauge);
// Link the artist chart to the yearly sales gauge
$artistSales->autoLink($yearlySalesGauge);
Dashboard::Render();
开发者ID:KeyMaker13,项目名称:scrum,代码行数:31,代码来源:test.php


注:本文中的Dashboard::addComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。