我正在尝试在Laravel 5上实现LavaCharts,但不知道如何渲染它。试图遵循文档,但这对我不起作用。
虽然不确定如何在View中显示它。遵循这一点但不起作用http://lavacharts.com/#example-donut。我错过了什么吗?如何在视图中调用此函数?
这是我的控制器
public function getPie () {
$reasons = Lava::DataTable();
$reasons->addStringColumn('Reasons')
->addNumberColumn('Percent')
->addRow(array('Check Reviews', 5))
->addRow(array('Watch Trailers', 2))
->addRow(array('See Actors Other Work', 4))
->addRow(array('Settle Argument', 89));
$donutchart = Lava::DonutChart('IMDB')
->setOptions(array(
'datatable' => $reasons,
'title' => 'Reasons I visit IMDB'
));
return $donutchart;
}
这是我的观点
<div id="chart-div"></div>
@donutchart('IMDB', 'chart-div')
答案 0 :(得分:4)
以下是我在Laravel 5中使用的代码。
public function getPie()
{
$lava = new Lavacharts;
$reasons = $lava->DataTable();
$reasons->addStringColumn('Reasons')
->addNumberColumn('Percent')
->addRow(array('Check Reviews', 5))
->addRow(array('Watch Trailers', 2))
->addRow(array('See Actors Other Work', 4))
->addRow(array('Settle Argument', 89));
$donutchart = $lava->DonutChart('IMDB', $reasons, [
'title' => 'Reasons I visit IMDB'
]);
return view('welcome', [
'lava' => $lava
]);
}
在你看来
<div id="chart-div"></div>
{!! $lava->render('DonutChart', 'IMDB', 'chart-div') !!}
答案 1 :(得分:0)
Sub OpenWebSelectClickSaveHtmlFile()
Dim URL As String
URL = "http://formulaacademia.com.br/academia"
Set myIE = CreateObject("InternetExplorer.Application")
With myIE
.navigate URL
.Visible = True
Do While .Busy = True Or .readyState <> 4
Loop
DoEvents
Set selectitems = myIE.document.getElementsByTagName("button")
For Each i In selectitems
i.Click
Next i
End With
End Sub
在您看来:
public function getPie()
{
$lava = new Lavacharts;
$reasons = \Lava::DataTable();
$reasons->addStringColumn('Reasons')
->addNumberColumn('Percent')
->addRow(array('Check Reviews', 5))
->addRow(array('Watch Trailers', 2))
->addRow(array('See Actors Other Work', 4))
->addRow(array('Settle Argument', 89));
$donutchart = \Lava::DonutChart('IMDB', $reasons, [
'title' => 'Reasons I visit IMDB'
]);
return view('welcome');
}