public function getChart($title, $chartType, $height, $width, $arrayColors, $datatTable) { if ($chartType = 'PieChart') { \Lava::PieChart($title)->setOptions(array('datatable' => $datatTable, 'legend' => \Lava::Legend(array('position' => 'none')), 'chartArea' => \Lava::ChartArea(['width' => $width, 'height' => $height]), 'colors' => $arrayColors, 'is3D' => true)); } elseif ($chartType = 'DonutChart') { } }
public function getChart(Request $request) { $reasons = \Lava::DataTable(); $reasons->addStringColumn('Reasons')->addNumberColumn('Percent')->addRow(array('Passed', 50))->addRow(array('Failed', 30))->addRow(array('Skipped', 20)); $piechart = \Lava::PieChart('myPieChart')->setOptions(array('datatable' => $reasons, 'legend' => \Lava::Legend(array('position' => 'none')), 'chartArea' => \Lava::ChartArea(['width' => 250, 'height' => 250]), 'colors' => array('078B3E', 'CD1E35', 'FCDC27'))); $threedpiechart = \Lava::PieChart('myThreeDPieChart')->setOptions(array('datatable' => $reasons, 'legend' => \Lava::Legend(array('position' => 'none')), 'chartArea' => \Lava::ChartArea(['width' => 250, 'height' => 250]), 'colors' => array('368DB9', 'A41034', 'FCDC27'), 'is3D' => true)); $donutchart = \Lava::DonutChart('myDonut')->setOptions(array('datatable' => $reasons, 'legend' => \Lava::Legend(array('position' => 'none')), 'chartArea' => \Lava::ChartArea(['width' => 250, 'height' => 250]), 'colors' => array('368DB9', 'A41034', 'FCDC27'))); }