我试图在这里添加年度明智的记录
$defect_reported_by_year = Lava::DataTable();
$defect_reported_by_year->addDateColumn("Year")
->addNumberColumn('Value')
->setDateTimeFormat('Y')
->addRow(['2011', 20])
->addRow(['2012', 100])
->addRow(['2013', 22])
->addRow(['2014', 34])
->addRow(['2015', 65]);
Lava::ScatterChart('defect_reported_by_year', $defect_reported_by_year, [
'width' => 1000,
'height' => 500,
'title' => 'Defects Reported by Year',
'legend' => [
'position' => 'none'
]
]);

答案 0 :(得分:0)
我刚刚通过DateRange以避开范围。
$defect_reported_by_year = Lava::DataTable();
$defect_reported_by_year->addDateColumn("Year")
->addNumberColumn('Value')
->setDateTimeFormat('Y')
->addRow(['2011', 20])
->addRow(['2012', 100])
->addRow(['2013', 22])
->addRow(['2014', 34])
->addRow(['2015', 65]);
//Apply DateRange filter
$defect_reported_by_year->DateRangeFilter('Year', 1, 1, 'Y');
Lava::ScatterChart('defect_reported_by_year', $defect_reported_by_year, [
'width' => 1000,
'height' => 500,
'title' => 'Defects Reported by Year',
'legend' => [
'position' => 'none'
]
]);
没有测试过这个东西,这可能会对你有帮助。