Razorflow Php error :A non well formed numeric value encountered
Razorflow Php error :A non well formed numeric value encountered
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();
但是,我无法 运行 此代码成功。它总是以这个错误结束。
Message:
A non well formed numeric value encountered Trace:
C:\xampp\htdocs\rf_4\core\internal\RFDbDataSource.php:86
C:\xampp\htdocs\rf_4\demos\chart_drilldown1.php:6
提前致谢。
$totalTime = microtime() - $startTime;
错误(遇到格式不正确的数值)参考上面RFDbDataSource.php中的代码行。
Microtime Return current Unix timestamp with microseconds.
microtime() 参数的默认值为 false。微时间为true和false作为参数值的结果:
microtime() - as string
microtime(true) - as float
从 开始,我们对 microtime() 值进行减法运算。 microtime() 应该是 float 或 numbers.So,将 microtime()
更改为 microtime(true)
可以解决错误(遇到格式不正确的数值)。
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();
但是,我无法 运行 此代码成功。它总是以这个错误结束。
Message: A non well formed numeric value encountered Trace: C:\xampp\htdocs\rf_4\core\internal\RFDbDataSource.php:86 C:\xampp\htdocs\rf_4\demos\chart_drilldown1.php:6
提前致谢。
$totalTime = microtime() - $startTime;
错误(遇到格式不正确的数值)参考上面RFDbDataSource.php中的代码行。
Microtime Return current Unix timestamp with microseconds.
microtime() 参数的默认值为 false。微时间为true和false作为参数值的结果:
microtime() - as string
microtime(true) - as float
从 开始,我们对 microtime() 值进行减法运算。 microtime() 应该是 float 或 numbers.So,将 microtime()
更改为 microtime(true)
可以解决错误(遇到格式不正确的数值)。