1. Go to this page and download the library: Download helvetitec/lagoon-charts library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$timelineTable = new TimelineTable(true); //The parameter sets if the hours, minutes and seconds should be ineTable->addTask("Person 2", "Project 1", Carbon::now()->copy()->addHour(), Carbon::now()->copy()->addHours(2));
$data = $timelineTable->__toString(); //IMPORTANT USE __toString() here!
$switchAction = new \Helvetitec\LagoonCharts\Actions\SwitchAction("action", "Test Action");
$switchAction->addAction("alert('hello world!');"); //Adds a single javascript action to the list (starting at index 0)
$switchAction->addActionAt(0, "alert('hello world, again!');"); //Adds a single javascript action to a specific index
$switchStr = $switchAction->__toString();
$actions = [
$switchStr
];
$readyEvent = new \Helvetitec\LagoonCharts\Utils\Event(\Helvetitec\LagoonCharts\Utils\EventType::Ready, "alert('hello, i\'m ready');");
//The error event will de a selection variable, which represents chart.getSelection();
$selectEvent = new \Helvetitec\LagoonCharts\Utils\Event(\Helvetitec\LagoonCharts\Utils\EventType::Select, "alert(selection[0][0]);");
$eventArr = [
'ready' => $readyEvent->__toString(),
'error' => $errorEvent->__toString(),
'select' => $selectEvent->__toString()
];
blade
@lagoonScripts('en', 'gantt') <!-- To make Gantt Charts working, you'll need to load the package -->
@lagoonScripts('en', ['corechart', 'gantt']) <!-- If you have multiple chart types, add them as an array -->
blade
@lagoonScripts('en', 'timeline') <!-- To make Timeline Charts working, you'll need to load the package -->
@lagoonScripts('en', ['corechart', 'timeline']) <!-- If you have multiple chart types, add them as an array -->