Skip to content

Instantly share code, notes, and snippets.

@kevinkhill
Last active April 25, 2016 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinkhill/f625251114092a53c3c20d8f977e194c to your computer and use it in GitHub Desktop.
Save kevinkhill/f625251114092a53c3c20d8f977e194c to your computer and use it in GitHub Desktop.
Lavacharts Issue Solution
<?php
$employeeCount = rand(2,6);
$salesTable = $lava->DataTable();
$salesTable->addDateColumn('Date');
for ($a=0; $a <= $employeeCount; $a++) {
$salesTable->addNumberColumn('Employee'.$a);
}
for ($g=1;$g < 30; $g++) {
$rowData = ['2016-1-'.$g];
for ($b=0; $b <= $employeeCount; $b++) {
$rowData[] = rand(550000,1000000);
}
$salesTable->addRow($rowData);
}
$lava->LineChart('Sales', $salesTable, [
'legend'=>'bottom'
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment