
Chcę wyświetlić te dane na wykresie Highcharts
Mam kody
data.php
<?php $category['name'] = 'miesiac'; $series1['name'] = 'tempmax'; $series2['name'] = 'tempmin'; $series3['name'] = 'opady'; $category['data'][] = $r['miesiac']; $series1['data'][] = $r['tempmax']; $series2['data'][] = $r['tempmin']; $series3['data'][] = $r['opady']; } ?>
Kod odpowiedzialny za wyświetlanie
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { var options = { chart: { renderTo: 'container', type: 'area', marginRight: 130, marginBottom: 25 }, title: { text: 'Project Requests', x: -20 //center }, subtitle: { text: '', x: -20 }, xAxis: { categories: [] }, yAxis: { title: { text: 'Requests' }, plotLines: [{ value: 0, width: 1, color: '#808080' }] }, tooltip: { formatter: function() { return '<b>'+ this.series.name +'</b><br/>'+ this.x +': '+ this.y; } }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'top', x: -10, y: 100, borderWidth: 0 }, plotOptions: { area: { stacking: 'normal', lineColor: '#666666', lineWidth: 1, marker: { lineWidth: 1, lineColor: '#666666' } } }, series: [] } $.getJSON("data.php", function(json) { options.xAxis.categories = json[0]['data']; options.series[0] = json[1]; options.series[1] = json[2]; options.series[2] = json[3]; chart = new Highcharts.Chart(options); }); }); </script> <script src="http://code.highcharts.com/highcharts.js"></script> <script src="http://code.highcharts.com/modules/exporting.js"></script> </head> <body> <div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div> </body> </html>
Tu powinien być wykres ale nie ma
http://brzanek.webd.pl/area-chart-with-dat...harts/index.php
Coś jest nie tak tylko nie wiem co. Może ktoś mi pomóc.
Z góry dziękuję.