Created
May 21, 2014 00:50
-
-
Save wogsland/2f17423354f6c0aa99b9 to your computer and use it in GitHub Desktop.
highcharts barchart example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo HighRoller::setHighChartsLocation("highcharts.js");?> | |
<!-- $data is an array of 4 arrays: dates & vars on those dates --> | |
<?// Bar Chart | |
$barchart = new HighRollerAreaChart(); | |
$barchart->chart->renderTo = 'history'; | |
$barchart->chart->zoomType = 'x'; | |
$barchart->title->text = 'History'; | |
$barchart->yAxis->stackLabels = 'true'; | |
$barchart->scrollbar->enabled = 'true'; | |
$barchart->xAxis->categories = $data['dates']; | |
$barchart->xAxis->min = '1'; | |
$barchart->plotOptions->column->stacking = 'normal'; | |
$barchart->plotOptions->column->dataLabels->enabled = 'true'; | |
$barchart->plotOptions->column->dataLabels->color = 'white'; | |
$series1 = new HighRollerSeriesData(); | |
$series1->addName('Var 1')->addData($data['var1']); | |
$barchart->addSeries($series1); | |
$series2 = new HighRollerSeriesData(); | |
$series2->addName('Var 2')->addData($data['var2']); | |
$barchart->addSeries($series2); | |
$series3 = new HighRollerSeriesData(); | |
$series3->addName('Var 3')->addData($data['var3']); | |
$barchart->addSeries($series3); | |
?> | |
<div id="history"></div> | |
<script type="text/javascript"> | |
<?=$barchart->renderChart();?> | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment