-
Notifications
You must be signed in to change notification settings - Fork 142
Upgrading from 2.5 to 3.0
Kevin Hill edited this page Apr 25, 2016
·
7 revisions
In an effort to keep chart creation terse, the chart constructor has been extended. Charts now set the DataTable with the second parameter, and options if needed with the third.
$data = $lava->DataTable();
$lava->LineChart('StockPrices')
->datatable($data)
->setOptions(array(
'title' => 'Github Stock Price'
));
$data = $lava->DataTable();
$lava->LineChart('StockPrices', $data, [
'title' => 'Github Stock Price'
]);
Again, with the effort of minimal typing to create your charts, ConfigObjects are no longer required to be instantiated manually. Just pass in the same config array you would have to the constructor, as a value to the key. Internally, a ConfigObject (now called JsonConfigs) will be created and options will be checked/verified/assigned and applied to the chart as before.
$data = $lava->DataTable();
$lava->LineChart('StockPrices')->datatable($data)->setOptions(array(
'titleTextStyle' => $lava->TextStyle(array(
'fontName' => 'Arial',
'fontColor' => 'blue'
)),
'legend' => $lava->Legend(array(
'position' => 'top'
))
));
$data = $lava->DataTable();
$lava->LineChart('StockPrices', $data, [
'titleTextStyle' => [
'fontName' => 'Arial',
'fontColor' => 'blue'
],
'legend' => [
'position' => 'top'
]
]);
Complete Documentation available at lavacharts.com