<!-- brunodd: Get data from database --> <?php $raw = countSeriesByMakers(); $raw2 = countExercisesByMakers(); $makers = []; $seriesCounter = []; $exercisesCounter = []; foreach ($raw as $pair) { array_push($makers, loadName($pair->makerId)[0]->username); array_push($seriesCounter, (int) $pair->c); } foreach ($raw2 as $pair) { array_push($exercisesCounter, (int) $pair->c); } ?> <!-- 3. Add the JavaScript with the Highchart options to initialize the chart --> <script type="text/javascript"> $(function () { $('#container_created_per_user').highcharts({ chart: { type: 'column' }, title: { text: 'Contributions per user' }, xAxis: { title: { text: 'Makers' }, categories: <?php echo json_encode($makers);
<!-- brunodd: Get data from database --> <?php $raw = countSeriesByMakers(); $seriesPerUser = []; foreach ($raw as $pair) { $temp[0] = loadName($pair->makerId)[0]->username; $temp[1] = (int) $pair->c; array_push($seriesPerUser, $temp); } ?> <script type="text/javascript"> $(function () { $('#container_pie_example').highcharts({ chart: { plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false }, title: { text: 'Series created per user' }, tooltip: { pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' }, plotOptions: { pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true,