Example #1
0
 public function setRowDataSource($dsFunc, $db)
 {
     $this->setDashboard($db);
     $this->props->addItemToList("data.sources", "tableRowDataSource", array('url' => RFUtil::buildURL($this->getBasePath(), array('action' => 'getData', 'func' => $dsFunc, 'component' => $this->getID()))));
 }
Example #2
0
 private function buildRefreshURL()
 {
     $url = RFUtil::buildURL($this->getBasePath(), array('getDashboardAsJSON' => true));
     return $url;
 }
Example #3
0
 protected function createActionUrl($actionName, $func)
 {
     return RFUtil::buildURL($this->getBasePath(), array('action' => $actionName, 'func' => $func));
 }
Example #4
0
<?php

require "rf/razorflow.php";
$dataSource = RFUtil::getSampleDataSource();
// Create a chart to show aggregated sales by genre
$genreSales = new ChartComponent();
$genreSales->setCaption("Genre Sales");
$genreSales->setDataSource($dataSource);
$genreSales->setLabelExpression("Genre", "genre.Name");
$genreSales->addSeries("Sales", "track.UnitPrice * invoiceline.Quantity", array('sort' => "DESC"));
$genreSales->setOption('limit', 10);
Dashboard::addComponent($genreSales);
// Create a chart to show aggregated sales by artist
$artistSales = new ChartComponent();
$artistSales->setCaption("Artist Sales");
$artistSales->setDataSource($dataSource);
$artistSales->setLabelExpression("Artist", "artist.Name");
$artistSales->addSeries("Sales", "track.UnitPrice * invoiceline.Quantity", array('sort' => "DESC"));
$artistSales->setOption('limit', 10);
Dashboard::addComponent($artistSales);
// Link the artist chart to artist sales
$genreSales->autoLink($artistSales);
// Create a table component to show each sale.
$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' => '$'));