Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 14700

Ajuda com o Highcharts / PHP

$
0
0
Bom dia

Tenho o seguinte código

Código (PHP):
$queryeixo = "SELECT * FROM dss WHERE Time between '$datadeinicio' and '$datadefim' ORDER BY id asc";

$resulteixo = mysql_query($queryeixo) or die(mysql_error());

while ($row = mysql_fetch_array($resulteixo)){
$teste = "'".$row['Time']."'".",";

echo $teste;


e quando faço o echo do $teste , apareçe-me os valores correctos. mas tenho um script

Código (Javascript):
$(function () {
var chart;
$(document).ready(function() {
     chart = new Highcharts.Chart({
         chart: {
             renderTo: 'container',
             type: 'scatter',
             marginRight: 130,
             marginBottom: 25,
         },
         title: {
             text: 'Temperatures [ºC]', /* Cabeçalho do Gráfico - Título da Grandeza que está a ser lida */
             x: -20 //center
         },
         subtitle: {
             text: '.:Lactogal:.', /* Cabeçalho do Gráfico - Nome do Cliente */
             x: -20
         },
             xAxis: {
             data: [<?php echo $teste.','; ?>]
         },
         yAxis: {
             title: {
                 text: 'Temperature'
             },
             plotLines: [{
                 value: 0,
                 width: 1,
                 color: '#808080'
             }]
         },
         tooltip: {
             formatter: function() {
                     return '<b>'+ this.series.name +'</b><br/>'+
                     this.x +': '+ this.y +'°C';
             }
         },
         legend: {
             // layout: 'vertical',
             // align: 'right',
             //verticalAlign: 'top',
             x: -10,
             y: 100,
             borderWidth: 0
         },
         series: [{
             name: 'Temperature [ºC]',     /* legenda da serie um de valores*/
             data: [<?php $columnValues = Array();

while ( $row = mysql_fetch_assoc($result3) ) {
$columnValues[] = $row['T1 ©'];echo $row['T1 ©'].',';}?>]
         }]
    
     });
});

});
$('#getcsv').click(function () {
alert(chart.getCSV());
});


e nesta parte do código
Código :
xAxis: {
             data: [<?php echo $teste.','; ?>]

Não me aparecem os valores da coluna, apenas me aparece um valor.....Esta coluna será o eixo do x com os valores de data....

Alguém me pode ajudar? Obrigado

Viewing all articles
Browse latest Browse all 14700