【发布时间】:2019-11-17 16:35:45
【问题描述】:
RazorFlow PHP 是一个 PHP 框架,可用于构建交互式数据驱动仪表板,可在 PC、Mac、平板电脑和智能手机上运行。 razorflow php 中提供了 11 个演示项目。这是其中之一。我想知道它是如何工作的。我检查了 razorflow.php 和 $dataSource 的路径。
<?php
require "../razorflow.php";
Dashboard::setTitle("Drill-down in same chart");
$dataSource = new SQLiteDataSource("databases/birt.sqlite");
$dataSource->setSQLSource("payments JOIN customers ON payments.customerNumber = customers.customerNumber");
$drillCategory = new ChartComponent();
$drillCategory->setWidth(4);
$drillCategory->setCaption("Drill-down by category", "Sales for {{value}}");
$drillCategory->setYAxis("Sales", array('numberPrefix' => "$"));
$drillCategory->setDataSource($dataSource);
$drillCategory->setLabelExpression("Location", "customers.country", array(
'drillPath' => array('customers.country', 'customers.state', 'customers.city', 'customers.customerName')
));
$drillCategory->addSeries("Sales", "payments.amount", array(
'displayType' => 'Column'
));
Dashboard::addComponent($drillCategory);
$drillTime = new ChartComponent();
$drillTime->setCaption("Drill-down by time", "Sales for {{value}}");
$drillTime->setYAxis("Sales", array('numberPrefix' => "$"));
$drillTime->setWidth(4);
$drillTime->setDataSource($dataSource);
$drillTime->setLabelExpression("Time", "payments.paymentDate", array(
'timestampRange' => true,
'autoDrill' => true
));
$drillTime->addSeries("Sales", "payments.amount", array(
'displayType' => 'Column'
));
Dashboard::addComponent($drillTime);
Dashboard::Render();
但是,我无法成功运行此代码。它总是以这个错误结束。
消息: 遇到一个格式不正确的数值 Trace: C:\xampp\htdocs\rf_4\core\internal\RFDbDataSource.php:86 C:\xampp\htdocs\rf_4\demos\chart_drilldown1.php:6
提前致谢。
【问题讨论】: