Clipper On Line • Ver Tópico - PHP: exibir gráfico com dados obtidos de uma tabela MySQL

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Discussão sobre outras linguagens de programação.

Moderador: Moderadores

 

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor cjp » 09 Abr 2020 01:21

Pessoal, estou tentando usar um exemplo que vi na internet para exibir um gráfico com cotações. Juntei este exemplo com um outro que achei em outro site, que exibe o gráfico, mas não estou sabendo colocar a array que peguei aqui para exibir no gráfico. Alguém pode me ajudar?

Veja como fiz:

<?php
include("conexao.php");

conectk("","");

$sql = "SELECT dtcotacao,cotacao FROM acoes where codigo='PETR3' and compvenda=0"; //$result = $conn->query($sql);

$results = array((object) array( 'dtcotacao' => $row["dtcotacao"], 'cotacao' =>
$row["cotacao"] ));

//$conn->close(); ?>

google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);

  function drawChart() {
    var data = google.visualization.arrayToDataTable([array(object)]);

    var options = {
      title: 'Cotações de PETR3',
      curveType: 'function',
    };

    var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));

    chart.draw(data, options);
  }


Alguém pode me ajudar?
Inacio de Carvalho Neto
cjp
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1138
Data de registro: 19 Nov 2010 21:29
Cidade/Estado: paraná
Curtiu: 6 vezes
Mens.Curtidas: 10 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor ANDRIL » 09 Abr 2020 08:15

Esse código parece estar meio furado. Voce fez a query e não usou ela em momento algum. O $results esta usando campos de onde???
Quando arrumar o que disse acima e se é que o preenchimento após corrigido seja o correto coloque

var data = google.visualization.arrayToDataTable(<? echo( [array(object)] ) ?>);

A parte de código do google me parece ser Javascript então terá que printar o valor php na página usando a dica acima.

De uma forma geral poderia ver o que o gráfico em javascript pede como parâmetro, montar a string no php e printar ela no javascript.

<? 
$coluna = "var eixos = [[1,2,3],[a,b,c]];" ;
?>


Na parte de javascript da página

<script language="javascript">
function MeuGrafico(){
   <? echo( $coluna); ?>
   alert(eixos);
}
</script>

Até+
Clipper 5.2e / Blinker 5.1
Harbour 3.0 e 3.2
------------------------
Visitem http://www.nsi-sp.com
Avatar de usuário

ANDRIL
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1160
Data de registro: 06 Jul 2004 00:44
Curtiu: 10 vezes
Mens.Curtidas: 34 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor cjp » 09 Abr 2020 09:15

Desculpe, mas é que meu conhecimento de PHP é muitíssimo limitado.

Tentei fazer assim:

<?php

include("conexao.php");

conectk("","");

$sql = "SELECT dtcotacao,cotacao FROM acoes where codigo='PETR3' and compvenda=0";
$rs=mysql_query($sql);
if (!$rs)
{  echo '<BR>';
  echo mysql_error();
  echo '<BR>';

   echo '<BR>';
  echo $sql;
  echo '<BR>';
exit("Error in SQL");}

$rs = array((object) array(
      'dtcotacao' => $row["dtcotacao"],
      'cotacao' => $row["cotacao"]
    ));

?>    

  <html>
  <head>
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">
      google.charts.load('current', {'packages':['corechart']});
      google.charts.setOnLoadCallback(drawChart);
    
      function drawChart() {
       var data = google.visualization.arrayToDataTable(<? echo( [array(object)] ) ?>);

        var options = {
          title: 'Cotações de PETR3',
          curveType: 'function',
        };

        var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));

        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <div id="curve_chart" style="width: 900px; height: 500px"></div>
  </body>
</html>


Entretanto, está dando
Parse error: syntax error, unexpected '(object)' (object) (T_OBJECT_CAST), expecting '(' in /home/inaciocarvalho/www/php/grafico.php on line 42


Mas o object não está definido?
Inacio de Carvalho Neto
cjp
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1138
Data de registro: 19 Nov 2010 21:29
Cidade/Estado: paraná
Curtiu: 6 vezes
Mens.Curtidas: 10 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor ANDRIL » 09 Abr 2020 10:27

Fiz de cabeça sem testar, mais esse é o caminho
<?
$sql = "SELECT dtcotacao,cotacao FROM acoes where codigo='PETR3' and compvenda=0";
$rs=mysql_query($sql);

$obj = "['Dt.Cotacao', 'Cotacao'],";
while ($l = mysql_fetch_array($rs)){
   $obj.="['".$l['dtcotacao']."','".$l['cotacao']."'],";
}
$obj = "[".substr($obj,0,strlen($obj)-1)."]";

?>


Altere esta linha

var data = google.visualization.arrayToDataTable(<? echo( [array(object)] ) ?>);
para
var data = google.visualization.arrayToDataTable(<? echo( $obj ) ?>);
Clipper 5.2e / Blinker 5.1
Harbour 3.0 e 3.2
------------------------
Visitem http://www.nsi-sp.com
Avatar de usuário

ANDRIL
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1160
Data de registro: 06 Jul 2004 00:44
Curtiu: 10 vezes
Mens.Curtidas: 34 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor cjp » 09 Abr 2020 11:22

Deu este erro:

Data column(s) for axis #0 cannot be of type string
Inacio de Carvalho Neto
cjp
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1138
Data de registro: 19 Nov 2010 21:29
Cidade/Estado: paraná
Curtiu: 6 vezes
Mens.Curtidas: 10 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor ANDRIL » 09 Abr 2020 12:09

Esse erro já é do próprio gráfico. O motivo deve ser ou por que sua query não esteja trazendo dados ou o formato que o gráfico exige esta errado na montagem da construção no PHP.

$sql = "SELECT dtcotacao,cotacao FROM acoes where codigo='PETR3' and compvenda=0";
$rs=mysql_query($sql);

$obj = "['Dt.Cotacao', 'Cotacao'],";
if (mysql_num_rows($rs)==0){
   $obj.="['Nenhuma data', 0],";
}else{
   while ($l = mysql_fetch_array($rs)){
      $obj.="['".$l['dtcotacao']."',".$l['cotacao']."],";
   }
}
$obj = "[".substr($obj,0,strlen($obj)-1)."]";

Use este novo código tratado.

O esquema de montagem no PHP esta ok, agora veja como o gráfico que esta montando precisa dos campos. Verifique se tem que adicionar colunas com o tipo de dados (string, date, numeric etc). Consulte o manual do gráfico em questão.
Clipper 5.2e / Blinker 5.1
Harbour 3.0 e 3.2
------------------------
Visitem http://www.nsi-sp.com
Avatar de usuário

ANDRIL
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1160
Data de registro: 06 Jul 2004 00:44
Curtiu: 10 vezes
Mens.Curtidas: 34 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor cjp » 09 Abr 2020 13:54

Agora, aparentemente, funcionou.
Mas o gráfico não ficou correto. Veja a imagem anexa.
O mesmo select, no HeidiSQL, fornece os dados corretamente, conforme anexo.
Não entendo disso, mas vi no modelo inicial do gráfico que ele usava uma array comum, com data e valor.
Anexos
petr3.txt
(33.02 KiB) Baixado 264 vezes
grafico.png
Inacio de Carvalho Neto
cjp
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1138
Data de registro: 19 Nov 2010 21:29
Cidade/Estado: paraná
Curtiu: 6 vezes
Mens.Curtidas: 10 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor ANDRIL » 09 Abr 2020 14:45

Não sei o que voce espera do gráfico, o meu teste aqui ficou assim
FORUM - GRAFICO INACIO.jpg


Da um echo($obj) no seu código php, o meu esta saindo assim:
[['Dt.Cotacao', 'Cotacao'],['2020-03-26',14.24],['2020-03-27',13.45],['2020-03-31',14.01],['2020-04-01',14.19],['2020-04-02',15.16],['2020-04-03',15.07],['2020-04-04',15.32],['2020-04-05',15.32],['2020-04-06',15.32],['2020-04-07',16.15],['2020-04-08',16.56],['2020-04-09',17.50]]


esses são os dados que seu gráfico espera no Javascript.
Até+
Clipper 5.2e / Blinker 5.1
Harbour 3.0 e 3.2
------------------------
Visitem http://www.nsi-sp.com
Avatar de usuário

ANDRIL
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1160
Data de registro: 06 Jul 2004 00:44
Curtiu: 10 vezes
Mens.Curtidas: 34 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor cjp » 09 Abr 2020 15:46

Sim, o gráfico que eu esperava era exatamente assim como vc mostrou. Vc obteve esse gráfico com os mesmos dados que estou usando?

echo $obj resultou isto:

[['Dt.Cotacao', 'Cotacao'],['2016-03-24',9.70],['2016-04-01',10.26],['2016-04-01',10.30],['2016-04-15',11.97],['2016-04-18',11.66],['2016-04-22',12.84],['2016-04-26',12.90],['2016-04-29',13.27],['2016-05-02',13.00],['2016-05-05',13.45],['2016-05-09',11.78],['2016-05-12',10.25],['2016-05-16',12.65],['2016-05-18',12.31],['2016-05-19',11.61],['2016-05-24',11.07],['2016-05-31',10.31],['2016-06-01',10.14],['2016-06-02',10.67],['2016-06-03',10.80],['2016-06-07',11.17],['2016-06-08',12.03],['2016-06-10',11.35],['2016-06-15',10.79],['2016-06-17',11.42],['2016-06-20',11.39],['2016-06-21',11.50],['2016-06-23',11.91],['2016-06-24',12.05],['2016-06-26',11.43],['2016-06-28',11.34],['2016-06-30',11.57],['2016-07-04',12.06],['2016-07-05',11.62],['2016-07-08',11.97],['2016-07-11',12.52],['2016-07-21',13.65],['2016-07-27',13.92],['2016-08-01',14.09],['2016-08-04',13.58],['2016-08-10',13.75],['2016-08-12',13.91],['2016-08-16',14.43],['2016-08-19',15.13],['2016-08-22',14.63],['2016-08-25',14.73],['2016-08-29',15.11],['2016-09-01',14.87],['2016-09-05',15.94],['2016-09-09',16.05],['2016-09-13',15.78],['2016-09-13',14.81],['2016-09-19',15.10],['2016-09-27',14.65],['2016-10-02',15.14],['2016-10-25',19.35],['2016-11-09',17.28],['2016-11-30',18.32],['2016-12-01',19.01],['2016-12-08',18.28],['2016-12-12',18.59],['2016-12-19',17.38],['2016-12-26',16.77],['2017-02-09',15.51],['2017-04-06',15.36],['2017-08-11',13.51],['2017-08-21',13.85],['2017-08-31',14.12],['2017-09-06',15.24],['2017-09-25',16.34],['2017-10-03',16.31],['2017-10-04',16.45],['2017-10-05',16.64],['2017-10-16',16.77],['2017-10-23',16.59],['2017-10-30',17.42],['2017-11-22',16.60],['2017-12-01',16.18],['2017-12-28',16.91],['2018-01-30',21.09],['2018-02-19',21.18],['2018-02-26',23.08],['2018-03-22',23.53],['2018-04-02',22.88],['2018-04-05',23.55],['2018-04-06',23.31],['2018-04-10',23.31],['2018-04-10',23.74],['2018-04-11',24.29],['2018-04-11',24.28],['2018-04-16',23.07],['2018-04-18',24.17],['2018-04-19',24.34],['2018-04-25',23.42],['2018-04-26',24.08],['2018-05-09',25.90],['2018-05-09',27.53],['2018-05-10',29.11],['2018-05-11',29.45],['2018-05-14',29.91],['2018-05-14',30.16],['2018-05-14',30.30],['2018-05-15',30.50],['2018-05-15',30.78],['2018-05-15',31.21],['2018-05-18',30.49],['2018-05-21',29.47],['2018-05-22',28.38],['2018-05-22',28.32],['2018-05-23',27.68],['2018-05-23',9999.99],['2018-05-24',24.04],['2018-05-24',23.60],['2018-05-24',23.35],['2018-05-24',23.50],['2018-05-24',23.16],['2018-05-25',24.25],['2018-05-25',23.52],['2018-05-26',23.03],['2018-05-28',21.95],['2018-05-29',21.24],['2018-05-29',22.04],['2018-05-29',21.99],['2018-05-29',22.01],['2018-05-29',21.91],['2018-05-29',22.20],['2018-05-30',21.93],['2018-05-30',22.39],['2018-06-01',22.00],['2018-06-01',19.05],['2018-06-01',18.74],['2018-06-01',19.20],['2018-06-04',20.20],['2018-06-04',20.19],['2018-06-06',19.29],['2018-06-06',19.09],['2018-06-07',19.03],['2018-06-07',18.92],['2018-06-07',18.72],['2018-06-07',18.27],['2018-06-07',18.59],['2018-06-08',18.70],['2018-06-08',18.24],['2018-06-08',18.05],['2018-06-08',18.17],['2018-06-08',18.25],['2018-06-08',18.55],['2018-06-09',18.04],['2018-06-11',18.06],['2018-06-11',18.35],['2018-06-13',17.77],['2018-06-18',17.33],['2018-06-19',17.90],['2018-06-19',15.50],['2018-06-20',18.29],['2018-06-20',16.27],['2018-06-21',18.05],['2018-06-21',17.85],['2018-06-21',17.72],['2018-06-22',18.09],['2018-06-22',17.95],['2018-06-22',17.88],['2018-06-22',17.76],['2018-06-23',17.76],['2018-06-25',18.01],['2018-06-25',17.68],['2018-06-25',18.11],['2018-06-26',18.41],['2018-06-26',18.33],['2018-06-26',18.01],['2018-06-26',18.28],['2018-06-26',18.26],['2018-06-26',18.37],['2018-06-28',19.21],['2018-06-28',19.18],['2018-06-29',19.10],['2018-06-29',19.10],['2018-07-02',19.38],['2018-07-04',19.55],['2018-07-05',20.09],['2018-07-06',20.10],['2018-07-09',20.22],['2018-07-10',20.57],['2018-07-11',20.39],['2018-07-11',20.52],['2018-07-11',20.33],['2018-07-12',20.02],['2018-07-12',20.30],['2018-07-12',20.42],['2018-07-12',20.66],['2018-07-13',20.60],['2018-07-13',20.60],['2018-07-13',20.52],['2018-07-13',20.53],['2018-07-13',20.46],['2018-07-16',20.58],['2018-07-16',20.20],['2018-07-16',20.07],['2018-07-16',20.08],['2018-07-16',20.12],['2018-07-16',20.14],['2018-07-16',20.29],['2018-07-17',20.93],['2018-07-19',20.60],['2018-07-19',20.52],['2018-07-19',20.53],['2018-07-19',20.70],['2018-07-19',20.55],['2018-07-19',20.52],['2018-07-20',21.31],['2018-07-20',21.34],['2018-07-21',21.42],['2018-07-23',21.48],['2018-07-24',22.09],['2018-07-24',21.90],['2018-07-24',21.84],['2018-07-24',21.83],['2018-07-24',21.89],['2018-07-25',21.90],['2018-07-25',21.95],['2018-07-25',22.11],['2018-07-25',22.10],['2018-07-25',22.09],['2018-07-26',21.80],['2018-07-26',21.79],['2018-07-26',21.72],['2018-07-26',21.62],['2018-07-27',22.06],['2018-07-27',22.01],['2018-07-27',22.01],['2018-07-27',22.10],['2018-07-30',22.37],['2018-07-30',21.94],['2018-07-30',22.09],['2018-07-30',22.06],['2018-07-31',22.06],['2018-07-31',21.90],['2018-07-31',21.63],['2018-07-31',21.63],['2018-07-31',21.90],['2018-07-31',21.94],['2018-08-01',21.94],['2018-08-01',21.70],['2018-08-01',21.99],['2018-08-01',21.81],['2018-08-01',21.84],['2018-08-01',21.84],['2018-08-01',21.86],['2018-08-01',21.82],['2018-08-01',22.03],['2018-08-02',22.07],['2018-08-02',22.07],['2018-08-02',22.37],['2018-08-02',22.56],['2018-08-03',23.60],['2018-08-03',23.23],['2018-08-03',23.33],['2018-08-03',23.19],['2018-08-03',23.24],['2018-08-03',23.25],['2018-08-03',23.22],['2018-08-06',23.50],['2018-08-06',23.55],['2018-08-06',23.53],['2018-08-07',23.43],['2018-08-08',23.13],['2018-08-08',22.89],['2018-08-09',22.82],['2018-08-09',22.65],['2018-08-09',22.49],['2018-08-09',22.76],['2018-08-10',22.38],['2018-08-10',22.23],['2018-08-10',22.16],['2018-08-13',22.16],['2018-08-13',22.11],['2018-08-13',22.30],['2018-08-13',22.25],['2018-08-13',22.41],['2018-08-14',22.64],['2018-08-14',22.27],['2018-08-14',22.24],['2018-08-14',22.40],['2018-08-15',22.26],['2018-08-15',21.57],['2018-08-15',21.58],['2018-08-15',21.72],['2018-08-15',21.76],['2018-08-16',21.38],['2018-08-16',21.31],['2018-08-16',21.48],['2018-08-16',21.37],['2018-08-16',21.31],['2018-08-16',21.23],['2018-08-16',21.29],['2018-08-17',21.04],['2018-08-17',20.94],['2018-08-17',21.02],['2018-08-17',21.00],['2018-08-17',20.95],['2018-08-17',20.95],['2018-08-20',20.95],['2018-08-20',20.95],['2018-08-20',20.79],['2018-08-20',20.70],['2018-08-20',20.87],['2018-08-20',20.86],['2018-08-21',21.00],['2018-08-21',20.93],['2018-08-21',21.02],['2018-08-21',20.87],['2018-08-21',20.65],['2018-08-22',9999.99],['2018-08-22',20.67],['2018-08-22',20.91],['2018-08-22',21.12],['2018-08-22',21.23],['2018-08-23',21.19],['2018-08-23',21.04],['2018-08-23',21.14],['2018-08-23',21.00],['2018-08-24',21.19],['2018-08-24',21.02],['2018-08-24',20.98],['2018-08-27',21.06],['2018-08-27',21.25],['2018-08-27',21.31],['2018-08-27',21.35],['2018-08-27',21.31],['2018-08-27',21.34],['2018-08-27',21.36],['2018-08-27',21.43],['2018-08-27',21.32],['2018-08-28',21.45],['2018-08-28',21.45],['2018-08-28',21.45],['2018-08-28',21.39],['2018-08-28',21.33],['2018-08-28',21.28],['2018-08-28',21.42],['2018-08-28',21.45],['2018-08-28',21.42],['2018-08-28',21.37],['2018-08-28',21.30],['2018-08-29',21.24],['2018-08-29',21.68],['2018-08-29',21.82],['2018-08-29',21.88],['2018-08-29',21.88],['2018-08-29',22.19],['2018-08-29',22.24],['2018-08-29',22.20],['2018-08-29',22.19],['2018-08-29',22.17],['2018-08-30',22.17],['2018-08-30',22.17],['2018-08-30',21.93],['2018-09-03',21.69],['2018-09-06',21.74],['2018-09-10',22.54],['2018-09-10',22.39],['2018-09-12',22.16],['2018-09-12',22.27],['2018-09-12',22.16],['2018-09-13',22.16],['2018-09-13',22.25],['2018-09-17',22.36],['2018-09-20',23.11],['2018-09-24',23.22],['2018-09-24',23.59],['2018-09-24',23.43],['2018-09-24',23.41],['2018-09-24',23.18],['2018-09-25',23.15],['2018-09-25',23.15],['2018-09-25',23.17],['2018-09-25',23.17],['2018-09-25',23.31],['2018-09-25',23.27],['2018-09-26',23.27],['2018-09-26',23.27],['2018-09-26',23.40],['2018-09-26',23.22],['2018-09-26',23.10],['2018-09-26',23.36],['2018-09-26',23.36],['2018-09-27',23.36],['2018-09-27',23.36],['2018-09-27',24.34],['2018-09-27',24.32],['2018-09-27',24.24],['2018-09-27',24.31],['2018-09-28',24.50],['2018-09-28',24.86],['2018-09-28',24.72],['2018-09-28',24.70],['2018-09-28',24.30],['2018-09-28',24.23],['2018-10-01',24.23],['2018-10-01',24.23],['2018-10-01',23.97],['2018-10-01',24.04],['2018-10-01',24.12],['2018-10-02',25.78],['2018-10-04',26.44],['2018-10-04',26.64],['2018-10-08',29.11],['2018-10-08',29.00],['2018-10-08',29.06],['2018-10-08',29.14],['2018-10-15',28.10],['2018-10-15',28.85],['2018-10-17',29.51],['2018-10-18',28.81],['2018-10-18',28.88],['2018-10-23',29.14],['2018-10-23',29.27],['2018-10-26',29.10],['2018-10-26',29.86],['2018-10-29',29.24],['2018-10-31',30.28],['2018-10-31',30.10],['2018-11-01',30.00],['2018-11-06',30.04],['2018-11-06',30.10],['2018-11-08',29.61],['2018-11-09',27.71],['2018-11-12',28.13],['2018-11-12',28.13],['2018-11-12',28.13],['2018-11-12',28.08],['2018-11-12',28.36],['2018-11-12',28.04],['2018-11-13',27.99],['2018-11-13',27.99],['2018-11-13',27.61],['2018-11-13',27.15],['2018-11-13',26.94],['2018-11-13',27.01],['2018-11-14',27.20],['2018-11-14',27.19],['2018-11-16',27.79],['2018-11-19',28.18],['2018-11-20',28.03],['2018-11-20',28.03],['2018-11-20',28.03],['2018-11-20',28.03],['2018-11-21',27.36],['2018-11-21',27.18],['2018-11-21',27.24],['2018-11-21',27.27],['2018-11-21',26.97],['2018-11-21',26.78],['2018-11-21',26.79],['2018-11-21',26.73],['2018-11-21',26.76],['2018-11-21',26.91],['2018-11-21',27.06],['2018-11-21',27.17],['2018-11-21',27.14],['2018-11-21',27.13],['2018-11-21',27.21],['2018-11-21',27.24],['2018-11-21',27.18],['2018-11-22',27.38],['2018-11-22',27.38],['2018-11-22',27.30],['2018-11-22',27.41],['2018-11-22',27.35],['2018-11-22',27.26],['2018-11-22',27.20],['2018-11-22',27.23],['2018-11-22',27.15],['2018-11-22',27.38],['2018-11-23',26.70],['2018-11-23',26.20],['2018-11-23',26.24],['2018-11-23',26.22],['2018-11-23',26.24],['2018-11-23',26.59],['2018-11-23',26.63],['2018-11-23',26.37],['2018-11-23',26.47],['2018-11-23',26.44],['2018-11-23',26.44],['2018-11-23',26.45],['2018-11-23',26.50],['2018-11-23',26.56],['2018-11-23',26.57],['2018-11-23',26.64],['2018-11-23',26.58],['2018-11-26',26.69],['2018-11-26',26.69],['2018-11-26',27.13],['2018-11-26',27.17],['2018-11-26',26.97],['2018-11-26',27.09],['2018-11-26',27.11],['2018-11-26',26.85],['2018-11-26',26.87],['2018-11-26',26.98],['2018-11-27',27.10],['2018-11-27',27.14],['2018-11-27',27.53],['2018-11-27',27.66],['2018-11-27',28.01],['2018-11-28',28.28],['2018-11-28',28.15],['2018-11-28',27.50],['2018-11-28',27.68],['2018-11-28',27.59],['2018-11-28',27.64],['2018-11-29',27.67],['2018-11-29',27.47],['2018-11-29',27.67],['2018-11-29',27.67],['2018-11-29',27.67],['2018-11-29',27.81],['2018-11-29',27.87],['2018-11-29',27.85],['2018-11-29',27.55],['2018-11-29',27.46],['2018-11-29',27.69],['2018-11-29',27.72],['2018-11-29',27.78],['2018-11-29',27.84],['2018-11-29',27.84],['2018-11-30',27.85],['2018-11-30',27.85],['2018-11-30',27.80],['2018-11-30',27.77],['2018-11-30',27.85],['2018-11-30',27.83],['2018-11-30',27.65],['2018-11-30',27.77],['2018-11-30',27.77],['2018-11-30',27.93],['2018-11-30',28.10],['2018-11-30',28.18],['2018-11-30',28.15],['2018-11-30',28.19],['2018-12-03',28.13],['2018-12-03',29.18],['2018-12-03',29.16],['2018-12-03',29.13],['2018-12-03',29.15],['2018-12-03',29.16],['2018-12-03',29.17],['2018-12-03',29.16],['2018-12-03',29.14],['2018-12-03',28.74],['2018-12-04',29.08],['2018-12-04',28.52],['2018-12-04',28.50],['2018-12-04',28.42],['2018-12-05',28.42],['2018-12-05',28.42],['2018-12-05',27.98],['2018-12-05',28.23],['2018-12-05',28.22],['2018-12-05',28.42],['2018-12-05',28.56],['2018-12-05',28.54],['2018-12-06',27.86],['2018-12-06',27.99],['2018-12-06',27.13],['2018-12-06',27.29],['2018-12-06',27.29],['2018-12-07',28.05],['2018-12-07',28.38],['2018-12-07',28.33],['2018-12-07',27.84],['2018-12-10',27.61],['2018-12-10',27.54],['2018-12-10',26.71],['2018-12-10',26.67],['2018-12-10',26.62],['2018-12-11',26.85],['2018-12-12',26.59],['2018-12-12',26.39],['2018-12-13',26.45],['2018-12-13',26.41],['2018-12-13',26.39],['2018-12-17',26.58],['2018-12-18',25.75],['2018-12-18',25.68],['2018-12-18',25.60],['2018-12-18',25.65],['2018-12-18',25.70],['2018-12-18',25.59],['2018-12-18',25.42],['2018-12-19',25.07],['2018-12-19',24.92],['2018-12-19',24.54],['2018-12-19',24.98],['2018-12-19',25.46],['2018-12-19',25.64],['2018-12-19',24.76],['2018-12-20',24.55],['2018-12-20',24.22],['2018-12-21',23.90],['2018-12-21',24.66],['2018-12-26',23.41],['2018-12-26',23.61],['2018-12-26',24.08],['2018-12-28',25.22],['2018-12-28',25.25],['2018-12-28',25.17],['2018-12-28',25.29],['2018-12-28',25.60],['2019-01-01',25.40],['2019-01-02',25.40],['2019-01-02',25.27],['2019-01-02',25.15],['2019-01-02',25.48],['2019-01-02',25.90],['2019-01-02',26.78],['2019-01-02',26.79],['2019-01-02',26.81],['2019-01-02',26.78],['2019-01-02',26.71],['2019-01-03',26.65],['2019-01-03',27.16],['2019-01-03',27.19],['2019-01-03',26.77],['2019-01-03',26.81],['2019-01-03',26.74],['2019-01-03',26.65],['2019-01-03',27.20],['2019-01-04',27.20],['2019-01-04',27.20],['2019-01-04',27.20],['2019-01-04',27.24],['2019-01-04',27.41],['2019-01-04',27.36],['2019-01-04',27.23],['2019-01-04',27.29],['2019-01-04',27.33],['2019-01-04',27.32],['2019-01-04',27.50],['2019-01-07',27.97],['2019-01-07',28.01],['2019-01-07',28.07],['2019-01-07',28.54],['2019-01-08',28.65],['2019-01-08',28.34],['2019-01-08',28.57],['2019-01-08',28.57],['2019-01-08',28.49],['2019-01-09',28.67],['2019-01-09',28.60],['2019-01-09',28.84],['2019-01-09',28.95],['2019-01-09',28.87],['2019-01-10',28.65],['2019-01-10',28.49],['2019-01-10',28.65],['2019-01-10',28.56],['2019-01-10',28.68],['2019-01-11',28.68],['2019-01-11',28.51],['2019-01-11',28.39],['2019-01-11',28.41],['2019-01-11',28.50],['2019-01-14',28.20],['2019-01-14',28.53],['2019-01-14',28.56],['2019-01-14',28.50],['2019-01-15',28.62],['2019-01-15',28.58],['2019-01-16',28.22],['2019-01-16',28.38],['2019-01-16',28.40],['2019-01-17',28.72],['2019-01-17',28.71],['2019-01-17',28.76],['2019-01-17',28.78],['2019-01-17',28.78],['2019-01-18',29.16],['2019-01-18',28.97],['2019-01-18',28.97],['2019-01-21',28.92],['2019-01-21',28.84],['2019-01-21',28.90],['2019-01-21',29.13],['2019-01-22',28.96],['2019-01-22',29.02],['2019-01-22',29.04],['2019-01-22',28.89],['2019-01-22',28.90],['2019-01-23',28.85],['2019-01-23',29.16],['2019-01-23',29.29],['2019-01-23',29.24],['2019-01-23',28.99],['2019-01-24',29.26],['2019-01-24',29.33],['2019-01-25',29.46],['2019-01-25',29.46],['2019-01-25',29.46],['2019-01-25',29.46],['2019-01-28',29.46],['2019-01-28',29.24],['2019-01-28',29.39],['2019-01-28',28.79],['2019-01-28',28.42],['2019-01-28',28.52],['2019-01-28',28.54],['2019-01-29',28.42],['2019-01-29',28.88],['2019-01-29',29.20],['2019-01-29',29.12],['2019-01-29',29.29],['2019-01-29',29.37],['2019-01-30',29.62],['2019-01-30',29.50],['2019-01-30',29.37],['2019-01-30',29.53],['2019-01-31',29.44],['2019-01-31',29.81],['2019-01-31',29.79],['2019-01-31',29.74],['2019-01-31',29.69],['2019-01-31',29.87],['2019-01-31',29.61],['2019-02-01',29.55],['2019-02-01',29.53],['2019-02-01',29.77],['2019-02-01',29.77],['2019-02-01',29.70],['2019-02-01',29.89],['2019-02-04',29.98],['2019-02-04',29.85],['2019-02-04',30.17],['2019-02-04',30.41],['2019-02-05',30.36],['2019-02-05',30.31],['2019-02-05',30.27],['2019-02-05',30.48],['2019-02-05',30.68],['2019-02-06',30.55],['2019-02-06',30.55],['2019-02-06',30.11],['2019-02-06',30.28],['2019-02-06',30.31],['2019-02-07',30.01],['2019-02-07',30.01],['2019-02-07',30.54],['2019-02-07',30.16],['2019-02-07',29.97],['2019-02-07',29.51],['2019-02-08',29.48],['2019-02-08',29.26],['2019-02-08',29.49],['2019-02-08',29.10],['2019-02-08',29.15],['2019-02-08',29.31],['2019-02-11',29.27],['2019-02-11',29.07],['2019-02-11',29.06],['2019-02-11',28.86],['2019-02-11',29.05],['2019-02-11',29.05],['2019-02-12',28.90],['2019-02-12',28.90],['2019-02-12',29.91],['2019-02-12',29.86],['2019-02-12',29.77],['2019-02-12',29.94],['2019-02-13',29.94],['2019-02-13',30.27],['2019-02-13',30.21],['2019-02-13',30.21],['2019-02-13',9999.99],['2019-02-13',30.65],['2019-02-13',30.70],['2019-02-14',30.65],['2019-02-14',30.77],['2019-02-14',30.87],['2019-02-14',30.63],['2019-02-14',30.64],['2019-02-14',31.00],['2019-02-15',31.29],['2019-02-15',31.29],['2019-02-15',31.09],['2019-02-15',31.03],['2019-02-15',31.06],['2019-02-18',31.05],['2019-02-19',31.34],['2019-02-19',31.21],['2019-02-19',31.37],['2019-02-19',31.40],['2019-02-19',31.33],['2019-02-20',31.56],['2019-02-20',31.56],['2019-02-20',31.67],['2019-02-20',31.58],['2019-02-20',31.45],['2019-02-20',31.49],['2019-02-21',31.26],['2019-02-21',31.26],['2019-02-21',31.26],['2019-02-21',31.22],['2019-02-21',31.15],['2019-02-21',31.23],['2019-02-21',31.44],['2019-02-22',31.43],['2019-02-22',31.43],['2019-02-22',31.26],['2019-02-22',31.16],['2019-02-22',31.12],['2019-02-22',31.10],['2019-02-25',30.96],['2019-02-25',30.57],['2019-02-25',30.53],['2019-02-26',30.69],['2019-02-26',30.84],['2019-02-26',30.53],['2019-02-27',30.86],['2019-02-27',30.66],['2019-02-27',30.91],['2019-02-27',30.92],['2019-02-27',30.83],['2019-02-28',30.55],['2019-02-28',29.64],['2019-02-28',29.53],['2019-03-01',29.86],['2019-03-01',29.60],['2019-03-01',29.39],['2019-03-01',29.20],['2019-03-04',29.20],['2019-03-04',29.20],['2019-03-04',29.20],['2019-03-06',29.24],['2019-03-08',28.80],['2019-03-08',28.81],['2019-03-11',30.67],['2019-03-12',30.27],['2019-03-13',30.30],['2019-03-13',31.11],['2019-03-14',31.18],['2019-03-14',31.37],['2019-03-19',32.56],['2019-03-20',32.98],['2019-03-21',32.50],['2019-03-25',30.68],['2019-03-25',30.61],['2019-03-25',30.48],['2019-03-26',31.14],['2019-03-26',31.55],['2019-03-26',31.65],['2019-03-26',31.93],['2019-03-27',31.10],['2019-03-27',31.14],['2019-03-27',31.09],['2019-03-27',30.55],['2019-03-28',30.44],['2019-03-28',31.09],['2019-04-03',30.87],['2019-04-06',32.05],['2019-04-08',32.96],['2019-04-12',31.85],['2019-04-12',29.43],['2019-04-16',29.11],['2019-04-18',30.90],['2019-04-22',30.76],['2019-04-26',30.66],['2019-04-26',30.35],['2019-04-30',30.25],['2019-05-02',29.48],['2019-05-06',29.50],['2019-05-09',29.43],['2019-05-10',29.36],['2019-05-10',29.12],['2019-05-10',29.25],['2019-05-11',29.35],['2019-05-12',29.35],['2019-05-13',29.35],['2019-05-13',28.70],['2019-05-13',28.78],['2019-05-13',28.55],['2019-05-13',28.51],['2019-05-14',28.51],['2019-05-14',28.66],['2019-05-14',28.68],['2019-05-14',28.68],['2019-05-14',28.62],['2019-05-14',28.52],['2019-05-15',28.52],['2019-05-15',28.32],['2019-05-15',28.88],['2019-05-19',27.56],['2019-05-21',28.56],['2019-05-21',28.56],['2019-05-23',28.11],['2019-05-23',28.09],['2019-05-24',28.51],['2019-05-28',28.74],['2019-05-29',28.75],['2019-05-30',28.75],['2019-05-31',28.31],['2019-06-03',29.07],['2019-06-04',28.84],['2019-06-05',28.42],['2019-06-06',29.13],['2019-06-07',29.70],['2019-06-11',29.95],['2019-06-12',29.38],['2019-06-12',29.41],['2019-06-14',29.98],['2019-06-18',30.15],['2019-06-21',31.87],['2019-06-25',31.66],['2019-06-25',30.76],['2019-06-27',29.93],['2019-06-27',30.18],['2019-06-27',29.89],['2019-06-28',29.89],['2019-06-28',30.33],['2019-06-28',30.15],['2019-06-28',29.87],['2019-06-28',29.79],['2019-06-28',30.02],['2019-06-29',30.02],['2019-06-30',30.02],['2019-07-01',30.02],['2019-07-01',30.54],['2019-07-01',30.08],['2019-07-01',30.00],['2019-07-01',29.90],['2019-07-01',29.92],['2019-07-02',29.92],['2019-07-02',29.46],['2019-07-02',29.29],['2019-07-02',29.36],['2019-07-02',29.47],['2019-07-03',29.57],['2019-07-03',29.69],['2019-07-03',29.73],['2019-07-03',29.77],['2019-07-04',29.77],['2019-07-04',30.10],['2019-07-04',30.28],['2019-07-04',30.20],['2019-07-04',30.03],['2019-07-05',30.15],['2019-07-05',30.18],['2019-07-05',30.07],['2019-07-05',30.03],['2019-07-06',30.03],['2019-07-07',30.03],['2019-07-08',30.03],['2019-07-08',30.03],['2019-07-08',30.03],['2019-07-08',30.19],['2019-07-08',30.19],['2019-07-08',30.33],['2019-07-08',30.48],['2019-07-08',30.61],['2019-07-08',30.61],['2019-07-09',30.61],['2019-07-09',30.61],['2019-07-10',30.61],['2019-07-10',30.91],['2019-07-10',30.70],['2019-07-10',30.72],['2019-07-10',30.72],['2019-07-11',30.72],['2019-07-11',31.07],['2019-07-12',31.46],['2019-07-15',31.02],['2019-07-16',30.68],['2019-07-16',30.60],['2019-07-17',30.60],['2019-07-17',30.38],['2019-07-17',30.50],['2019-07-17',30.40],['2019-07-17',30.38],['2019-07-17',30.40],['2019-07-18',30.40],['2019-07-18',30.35],['2019-07-18',30.09],['2019-07-18',29.99],['2019-07-18',30.03],['2019-07-18',30.07],['2019-07-19',30.07],['2019-07-19',29.98],['2019-07-19',29.94],['2019-07-19',30.04],['2019-07-19',30.07],['2019-07-20',30.06],['2019-07-21',30.06],['2019-07-26',28.84],['2019-07-26',28.78],['2019-07-26',28.63],['2019-07-26',28.54],['2019-07-27',28.54],['2019-07-29',28.67],['2019-07-29',28.89],['2019-08-01',28.67],['2019-08-01',28.12],['2019-08-02',28.35],['2019-08-02',29.32],['2019-08-02',29.30],['2019-08-02',29.09],['2019-08-02',29.21],['2019-08-03',29.21],['2019-08-04',29.21],['2019-08-05',29.21],['2019-08-05',28.24],['2019-08-05',28.11],['2019-08-05',28.06],['2019-08-06',28.00],['2019-08-06',28.55],['2019-08-06',28.46],['2019-08-06',28.47],['2019-08-06',28.47],['2019-08-07',28.47],['2019-08-07',27.72],['2019-08-07',27.95],['2019-08-07',27.86],['2019-08-07',28.20],['2019-08-08',28.20],['2019-08-08',28.61],['2019-08-08',28.59],['2019-08-08',28.63],['2019-08-08',28.61],['2019-08-08',28.66],['2019-08-08',28.73],['2019-08-08',28.78],['2019-08-08',28.87],['2019-08-09',28.87],['2019-08-09',28.87],['2019-08-09',28.87],['2019-08-09',28.80],['2019-08-09',28.72],['2019-08-09',28.72],['2019-08-09',28.72],['2019-08-09',28.74],['2019-08-09',28.62],['2019-08-10',28.62],['2019-08-11',28.62],['2019-08-12',28.62],['2019-08-12',28.22],['2019-08-12',28.06],['2019-08-12',28.02],['2019-08-12',27.91],['2019-08-12',27.83],['2019-08-12',27.83],['2019-08-12',27.85],['2019-08-13',27.85],['2019-08-13',28.06],['2019-08-13',28.12],['2019-08-13',28.08],['2019-08-13',28.15],['2019-08-13',28.07],['2019-08-13',28.10],['2019-08-13',28.15],['2019-08-13',28.00],['2019-08-13',27.85],['2019-08-14',27.96],['2019-08-14',27.96],['2019-08-14',27.20],['2019-08-14',27.12],['2019-08-14',27.10],['2019-08-14',27.13],['2019-08-14',27.07],['2019-08-14',27.10],['2019-08-14',27.10],['2019-08-15',27.10],['2019-08-15',27.10],['2019-08-15',27.10],['2019-08-15',26.91],['2019-08-15',26.62],['2019-08-15',26.82],['2019-08-15',26.74],['2019-08-15',26.86],['2019-08-15',26.64],['2019-08-15',26.50],['2019-08-16',26.50],['2019-08-16',26.50],['2019-08-16',26.78],['2019-08-16',26.78],['2019-08-16',26.69],['2019-08-16',26.70],['2019-08-16',26.63],['2019-08-16',26.38],['2019-08-17',26.38],['2019-08-18',26.38],['2019-08-19',26.38],['2019-08-19',26.38],['2019-08-19',26.38],['2019-08-19',26.38],['2019-08-19',26.88],['2019-08-19',26.82],['2019-08-19',26.87],['2019-08-19',26.80],['2019-08-19',26.74],['2019-08-19',26.66],['2019-08-19',26.67],['2019-08-20',26.74],['2019-08-20',26.45],['2019-08-20',26.51],['2019-08-20',26.54],['2019-08-20',26.62],['2019-08-20',26.49],['2019-08-21',26.49],['2019-08-21',26.86],['2019-08-21',26.99],['2019-08-21',27.08],['2019-08-21',27.85],['2019-08-21',27.98],['2019-08-21',27.90],['2019-08-22',27.90],['2019-08-22',28.10],['2019-08-22',27.97],['2019-08-22',27.64],['2019-08-22',27.78],['2019-08-22',27.60],['2019-08-22',27.75],['2019-08-22',27.78],['2019-08-22',27.63],['2019-08-23',27.63],['2019-08-23',27.63],['2019-08-23',27.63],['2019-08-23',27.48],['2019-08-23',26.97],['2019-08-23',26.90],['2019-08-23',26.75],['2019-08-23',26.82],['2019-08-23',26.76],['2019-08-24',26.76],['2019-08-25',26.76],['2019-08-26',26.76],['2019-08-26',26.76],['2019-08-26',26.70],['2019-08-26',26.53],['2019-08-26',26.60],['2019-08-26',26.41],['2019-08-27',26.41],['2019-08-27',26.41],['2019-08-27',26.68],['2019-08-27',27.03],['2019-08-27',27.05],['2019-08-27',27.06],['2019-08-27',27.20],['2019-08-27',27.01],['2019-08-27',26.61],['2019-08-27',26.60],['2019-08-27',26.88],['2019-08-27',26.91],['2019-08-27',26.91],['2019-08-28',26.91],['2019-08-28',26.91],['2019-08-28',26.91],['2019-08-28',27.18],['2019-08-28',27.17],['2019-08-28',27.06],['2019-08-28',27.19],['2019-08-28',27.24],['2019-08-28',27.14],['2019-08-28',27.10],['2019-08-29',27.10],['2019-08-29',27.10],['2019-08-29',27.60],['2019-08-29',27.61],['2019-08-29',27.43],['2019-08-29',27.68],['2019-08-29',27.79],['2019-08-29',27.77],['2019-08-29',27.98],['2019-08-29',28.12],['2019-08-30',28.12],['2019-08-30',28.21],['2019-08-30',27.99],['2019-08-30',27.93],['2019-08-30',27.83],['2019-08-30',27.91],['2019-08-30',27.89],['2019-08-30',28.27],['2019-08-31',28.27],['2019-09-01',28.27],['2019-09-02',28.27],['2019-09-02',28.27],['2019-09-02',28.11],['2019-09-02',28.10],['2019-09-02',28.13],['2019-09-02',28.27],['2019-09-02',28.13],['2019-09-02',28.17],['2019-09-02',28.20],['2019-09-02',28.05],['2019-09-02',27.97],['2019-09-03',27.97],['2019-09-03',27.97],['2019-09-03',27.86],['2019-09-03',27.98],['2019-09-03',27.85],['2019-09-03',27.75],['2019-09-03',27.87],['2019-09-03',28.07],['2019-09-03',28.11],['2019-09-04',28.11],['2019-09-04',28.64],['2019-09-04',28.76],['2019-09-04',28.80],['2019-09-04',28.80],['2019-09-04',28.93],['2019-09-04',28.73],['2019-09-04',28.74],['2019-09-04',28.84],['2019-09-04',28.80],['2019-09-04',28.82],['2019-09-05',28.82],['2019-09-05',28.94],['2019-09-07',29.19],['2019-09-09',29.19],['2019-09-09',29.76],['2019-09-11',30.00],['2019-09-11',29.61],['2019-09-13',29.83],['2019-09-15',29.66],['2019-09-16',30.80],['2019-09-16',31.10],['2019-09-16',31.10],['2019-09-17',30.61],['2019-09-18',30.44],['2019-09-18',30.24],['2019-09-18',30.14],['2019-09-20',30.24],['2019-09-22',30.32],['2019-09-23',30.47],['2019-09-25',30.06],['2019-09-25',29.99],['2019-09-25',30.09],['2019-09-26',30.10],['2019-09-26',30.14],['2019-09-26',30.24],['2019-09-26',30.37],['2019-09-27',30.67],['2019-09-27',30.55],['2019-09-27',30.54],['2019-09-27',30.48],['2019-09-27',30.42],['2019-09-28',30.42],['2019-09-29',30.42],['2019-09-30',30.42],['2019-09-30',30.33],['2019-09-30',30.24],['2019-09-30',30.15],['2019-10-01',30.15],['2019-10-01',30.15],['2019-10-01',30.39],['2019-10-01',30.14],['2019-10-01',29.89],['2019-10-01',30.00],['2019-10-02',29.98],['2019-10-02',29.65],['2019-10-02',29.18],['2019-10-02',28.89],['2019-10-02',29.07],['2019-10-03',28.90],['2019-10-03',28.90],['2019-10-03',28.79],['2019-10-03',29.12],['2019-10-04',29.12],['2019-10-04',29.11],['2019-10-04',28.49],['2019-10-04',28.55],['2019-10-05',28.85],['2019-10-06',28.85],['2019-10-07',28.85],['2019-10-07',28.85],['2019-10-07',28.74],['2019-10-07',28.72],['2019-10-07',28.44],['2019-10-07',28.40],['2019-10-08',28.40],['2019-10-08',28.22],['2019-10-09',28.22],['2019-10-09',28.59],['2019-10-09',28.54],['2019-10-09',28.98],['2019-10-09',28.95],['2019-10-10',28.93],['2019-10-10',29.25],['2019-10-10',29.14],['2019-10-10',28.97],['2019-10-10',29.07],['2019-10-11',29.07],['2019-10-11',29.49],['2019-10-11',29.50],['2019-10-11',29.50],['2019-10-12',29.50],['2019-10-13',29.50],['2019-10-14',29.50],['2019-10-14',29.50],['2019-10-14',29.37],['2019-10-14',29.25],['2019-10-14',29.51],['2019-10-14',29.59],['2019-10-14',29.67],['2019-10-15',29.67],['2019-10-15',29.85],['2019-10-15',30.21],['2019-10-15',30.29],['2019-10-15',30.05],['2019-10-16',30.07],['2019-10-16',30.07],['2019-10-16',30.01],['2019-10-16',30.18],['2019-10-16',30.49],['2019-10-17',30.49],['2019-10-17',30.49],['2019-10-17',30.42],['2019-10-17',30.05],['2019-10-17',30.18],['2019-10-17',30.12],['2019-10-17',30.20],['2019-10-18',30.20],['2019-10-18',30.20],['2019-10-18',30.55],['2019-10-18',30.21],['2019-10-18',30.21],['2019-10-18',30.00],['2019-10-18',29.95],['2019-10-19',29.95],['2019-10-20',29.95],['2019-10-21',29.95],['2019-10-21',29.95],['2019-10-21',30.05],['2019-10-21',30.17],['2019-10-21',30.27],['2019-10-21',30.35],['2019-10-22',30.35],['2019-10-22',30.35],['2019-10-22',30.80],['2019-10-22',31.41],['2019-10-22',31.19],['2019-10-23',31.28],['2019-10-23',31.41],['2019-10-24',31.43],['2019-10-24',31.01],['2019-10-24',30.81],['2019-10-24',30.81],['2019-10-25',30.81],['2019-10-25',32.00],['2019-10-25',31.94],['2019-10-25',31.90],['2019-10-25',31.94],['2019-10-25',31.71],['2019-10-26',31.71],['2019-10-27',31.71],['2019-10-28',31.71],['2019-10-28',31.71],['2019-10-28',31.71],['2019-10-28',31.71],['2019-10-28',32.07],['2019-10-29',31.95],['2019-10-29',31.78],['2019-10-29',32.28],['2019-10-29',32.35],['2019-10-29',32.24],['2019-10-30',32.24],['2019-10-30',32.24],['2019-10-30',32.24],['2019-10-30',32.63],['2019-10-31',32.63],['2019-10-31',32.49],['2019-10-31',32.47],['2019-10-31',32.70],['2019-11-01',32.70],['2019-11-01',32.70],['2019-11-01',32.87],['2019-11-01',33.27],['2019-11-01',33.38],['2019-11-01',32.74],['2019-11-02',32.74],['2019-11-03',32.74],['2019-11-04',32.74],['2019-11-04',32.74],['2019-11-04',32.74],['2019-11-04',33.39],['2019-11-06',32.55],['2019-11-06',33.34],['2019-11-06',32.05],['2019-11-07',33.54],['2019-11-09',32.91],['2019-11-11',32.91],['2019-11-13',32.52],['2019-11-14',31.79],['2019-11-16',31.71],['2019-11-18',31.71],['2019-11-19',31.28],['2019-11-20',31.25],['2019-11-22',32.22],['2019-11-27',31.45],['2019-11-28',31.12],['2019-11-28',31.13],['2019-11-29',31.15],['2019-11-29',31.24],['2019-11-30',31.20],['2019-12-01',31.20],['2019-12-02',31.20],['2019-12-02',31.57],['2019-12-02',31.24],['2019-12-02',31.09],['2019-12-03',31.16],['2019-12-03',31.07],['2019-12-04',31.18],['2019-12-05',32.18],['2019-12-09',32.23],['2019-12-10',32.23],['2019-12-10',32.23],['2019-12-10',32.11],['2019-12-10',32.30],['2019-12-10',32.32],['2019-12-11',32.43],['2019-12-11',32.45],['2019-12-11',32.47],['2019-12-11',32.29],['2019-12-11',32.37],['2019-12-12',32.44],['2019-12-12',32.44],['2019-12-12',32.68],['2019-12-12',32.77],['2019-12-12',32.88],['2019-12-12',32.87],['2019-12-13',32.87],['2019-12-13',32.87],['2019-12-13',32.02],['2019-12-13',31.86],['2019-12-13',31.66],['2019-12-13',31.39],['2019-12-13',31.39],['2019-12-13',31.33],['2019-12-14',31.33],['2019-12-15',31.33],['2019-12-16',31.33],['2019-12-16',31.16],['2019-12-16',31.40],['2019-12-16',31.60],['2019-12-16',31.40],['2019-12-16',31.27],['2019-12-17',31.09],['2019-12-17',31.37],['2019-12-17',31.37],['2019-12-17',31.61],['2019-12-17',31.47],['2019-12-17',31.40],['2019-12-18',31.52],['2019-12-18',32.31],['2019-12-19',32.35],['2019-12-19',32.30],['2019-12-19',32.16],['2019-12-19',32.19],['2019-12-19',32.17],['2019-12-19',32.16],['2019-12-19',32.15],['2019-12-20',31.95],['2019-12-20',31.93],['2019-12-20',31.97],['2019-12-20',31.97],['2019-12-21',31.93],['2019-12-22',31.93],['2019-12-23',31.93],['2019-12-23',31.92],['2019-12-23',32.11],['2019-12-23',32.22],['2019-12-23',32.40],['2019-12-24',32.40],['2019-12-26',32.51],['2019-12-26',32.45],['2019-12-26',32.52],['2019-12-26',32.67],['2019-12-27',32.67],['2019-12-27',32.42],['2019-12-27',32.17],['2019-12-28',32.17],['2019-12-29',32.17],['2019-12-30',32.17],['2019-12-30',32.55],['2019-12-30',32.54],['2019-12-30',32.00],['2019-12-31',32.00],['2020-01-01',32.00],['2020-01-01',32.00],['2020-01-02',32.00],['2020-01-02',32.41],['2020-01-02',32.47],['2020-01-02',32.44],['2020-01-02',32.60],['2020-01-03',32.80],['2020-01-03',32.68],['2020-01-03',32.54],['2020-01-03',31.99],['2020-01-04',31.99],['2020-01-05',31.99],['2020-01-06',31.99],['2020-01-06',31.99],['2020-01-06',31.99],['2020-01-06',32.64],['2020-01-06',33.02],['2020-01-06',32.99],['2020-01-06',32.98],['2020-01-06',33.01],['2020-01-07',32.65],['2020-01-09',31.94],['2020-01-11',32.10],['2020-01-13',32.10],['2020-01-13',32.02],['2020-01-14',31.61],['2020-01-16',31.25],['2020-01-18',31.85],['2020-01-20',32.00],['2020-01-21',31.19],['2020-01-22',31.08],['2020-01-24',31.04],['2020-01-26',31.11],['2020-01-27',29.89],['2020-01-27',30.15],['2020-01-27',30.05],['2020-01-27',30.01],['2020-01-27',29.80],['2020-01-28',29.80],['2020-01-28',30.51],['2020-01-28',30.50],['2020-01-28',30.57],['2020-01-28',30.55],['2020-01-28',30.60],['2020-01-28',30.75],['2020-01-28',30.50],['2020-01-29',30.50],['2020-01-29',30.66],['2020-01-29',30.48],['2020-01-29',30.53],['2020-01-29',30.36],['2020-01-30',30.36],['2020-01-30',29.92],['2020-01-30',30.11],['2020-01-30',30.17],['2020-01-30',30.99],['2020-01-31',30.99],['2020-01-31',30.99],['2020-01-31',30.99],['2020-01-31',30.21],['2020-01-31',30.20],['2020-01-31',30.21],['2020-01-31',30.25],['2020-01-31',30.35],['2020-02-01',30.35],['2020-02-01',30.35],['2020-02-02',30.35],['2020-02-03',30.35],['2020-02-03',30.35],['2020-02-03',30.35],['2020-02-03',30.43],['2020-02-03',30.47],['2020-02-03',30.34],['2020-02-03',30.35],['2020-02-03',30.20],['2020-02-03',30.24],['2020-02-03',30.01],['2020-02-03',30.01],['2020-02-04',30.01],['2020-02-04',30.74],['2020-02-04',30.59],['2020-02-04',30.83],['2020-02-04',30.80],['2020-02-04',31.09],['2020-02-04',30.97],['2020-02-04',30.79],['2020-02-05',30.75],['2020-02-05',30.75],['2020-02-05',31.21],['2020-02-05',31.00],['2020-02-05',30.98],['2020-02-05',30.70],['2020-02-05',30.48],['2020-02-06',30.48],['2020-02-06',31.03],['2020-02-06',31.85],['2020-02-06',31.58],['2020-02-06',31.08],['2020-02-06',31.07],['2020-02-06',31.30],['2020-02-06',31.30],['2020-02-06',31.30],['2020-02-07',31.30],['2020-02-07',30.99],['2020-02-07',31.49],['2020-02-07',31.62],['2020-02-07',31.72],['2020-02-07',31.62],['2020-02-07',31.46],['2020-02-07',31.46],['2020-02-07',31.46],['2020-02-08',31.46],['2020-02-09',31.46],['2020-02-10',31.46],['2020-02-10',31.46],['2020-02-10',31.39],['2020-02-10',30.94],['2020-02-10',31.05],['2020-02-10',31.33],['2020-02-10',31.34],['2020-02-10',31.58],['2020-02-10',31.58],['2020-02-11',31.58],['2020-02-11',31.68],['2020-02-11',31.97],['2020-02-11',32.01],['2020-02-11',32.19],['2020-02-12',32.01],['2020-02-12',32.43],['2020-02-12',32.44],['2020-02-12',32.60],['2020-02-12',32.58],['2020-02-12',32.60],['2020-02-12',32.55],['2020-02-12',32.55],['2020-02-12',32.55],['2020-02-13',32.55],['2020-02-13',32.37],['2020-02-13',32.06],['2020-02-13',31.79],['2020-02-13',31.78],['2020-02-13',31.93],['2020-02-14',31.93],['2020-02-14',31.93],['2020-02-14',31.98],['2020-02-14',31.73],['2020-02-14',31.59],['2020-02-14',31.52],['2020-02-14',31.62],['2020-02-14',31.62],['2020-02-14',31.62],['2020-02-15',31.62],['2020-02-16',31.62],['2020-02-17',31.62],['2020-02-17',31.62],['2020-02-17',31.88],['2020-02-17',31.86],['2020-02-17',31.77],['2020-02-17',31.71],['2020-02-17',31.70],['2020-02-17',31.70],['2020-02-17',31.70],['2020-02-18',31.70],['2020-02-18',31.30],['2020-02-18',31.56],['2020-02-18',31.54],['2020-02-18',31.60],['2020-02-18',31.89],['2020-02-18',31.94],['2020-02-18',31.94],['2020-02-19',31.94],['2020-02-19',31.94],['2020-02-19',31.94],['2020-02-19',31.94],['2020-02-19',32.32],['2020-02-19',32.44],['2020-02-19',32.50],['2020-02-19',32.57],['2020-02-19',32.57],['2020-02-19',32.57],['2020-02-20',32.57],['2020-02-20',32.27],['2020-02-20',32.65],['2020-02-20',32.64],['2020-02-20',31.90],['2020-02-20',32.00],['2020-02-20',31.75],['2020-02-20',31.75],['2020-02-21',31.75],['2020-02-21',31.75],['2020-02-21',31.22],['2020-02-21',30.59],['2020-02-23',30.85],['2020-02-25',30.85],['2020-02-26',27.80],['2020-02-28',26.83],['2020-03-01',27.15],['2020-03-03',28.03],['2020-03-03',28.05],['2020-03-05',27.72],['2020-03-06',25.47],['2020-03-06',24.87],['2020-03-06',24.80],['2020-03-06',24.86],['2020-03-06',25.04],['2020-03-06',25.05],['2020-03-06',24.35],['2020-03-06',24.21],['2020-03-06',24.53],['2020-03-06',24.30],['2020-03-06',23.79],['2020-03-06',24.06],['2020-03-06',24.06],['2020-03-06',24.06],['2020-03-06',24.06],['2020-03-06',24.06],['2020-03-06',24.06],['2020-03-07',24.06],['2020-03-08',24.06],['2020-03-09',24.06],['2020-03-09',24.06],['2020-03-09',24.06],['2020-03-09',18.14],['2020-03-09',19.19],['2020-03-09',19.03],['2020-03-09',18.74],['2020-03-09',18.42],['2020-03-09',17.67],['2020-03-09',17.17],['2020-03-09',16.78],['2020-03-09',16.49],['2020-03-09',16.92],['2020-03-09',16.92],['2020-03-09',16.92],['2020-03-09',16.92],['2020-03-10',16.92],['2020-03-10',16.92],['2020-03-10',16.92],['2020-03-10',18.31],['2020-03-10',17.81],['2020-03-10',17.54],['2020-03-10',17.79],['2020-03-10',18.12],['2020-03-10',18.51],['2020-03-10',18.61],['2020-03-10',18.36],['2020-03-10',18.36],['2020-03-10',18.36],['2020-03-11',18.36],['2020-03-11',18.36],['2020-03-11',18.36],['2020-03-11',17.72],['2020-03-11',17.54],['2020-03-11',17.51],['2020-03-11',16.91],['2020-03-11',16.69],['2020-03-11',16.01],['2020-03-11',16.02],['2020-03-11',16.37],['2020-03-11',16.37],['2020-03-11',16.37],['2020-03-11',16.37],['2020-03-11',16.37],['2020-03-11',16.37],['2020-03-12',16.37],['2020-03-12',16.37],['2020-03-12',16.37],['2020-03-12',13.63],['2020-03-12',13.33],['2020-03-12',12.91],['2020-03-12',12.88],['2020-03-12',12.03],['2020-03-12',13.42],['2020-03-12',12.88],['2020-03-12',12.99],['2020-03-12',13.00],['2020-03-12',12.92],['2020-03-12',12.92],['2020-03-12',12.92],['2020-03-13',12.92],['2020-03-13',12.92],['2020-03-13',14.39],['2020-03-13',13.82],['2020-03-13',13.29],['2020-03-13',14.31],['2020-03-13',14.56],['2020-03-13',14.56],['2020-03-13',15.04],['2020-03-13',15.86],['2020-03-13',15.86],['2020-03-13',15.86],['2020-03-13',15.86],['2020-03-13',15.86],['2020-03-13',15.86],['2020-03-14',15.86],['2020-03-15',15.86],['2020-03-16',15.86],['2020-03-16',15.86],['2020-03-16',15.86],['2020-03-16',15.86],['2020-03-16',15.86],['2020-03-16',15.86],['2020-03-16',14.45],['2020-03-16',14.00],['2020-03-16',13.66],['2020-03-16',13.52],['2020-03-16',13.52],['2020-03-16',13.65],['2020-03-16',13.43],['2020-03-16',13.13],['2020-03-16',13.13],['2020-03-16',13.13],['2020-03-16',13.13],['2020-03-16',13.13],['2020-03-16',13.13],['2020-03-16',13.13],['2020-03-17',13.13],['2020-03-17',13.13],['2020-03-17',13.13],['2020-03-17',13.33],['2020-03-17',13.58],['2020-03-17',13.80],['2020-03-17',13.55],['2020-03-17',13.22],['2020-03-17',13.08],['2020-03-17',13.11],['2020-03-17',13.10],['2020-03-17',13.08],['2020-03-17',13.08],['2020-03-17',13.08],['2020-03-17',13.08],['2020-03-17',13.08],['2020-03-18',13.08],['2020-03-18',13.08],['2020-03-18',13.08],['2020-03-18',11.99],['2020-03-18',11.65],['2020-03-18',11.30],['2020-03-18',11.17],['2020-03-18',10.65],['2020-03-18',10.59],['2020-03-18',10.95],['2020-03-18',11.05],['2020-03-18',11.05],['2020-03-18',11.05],['2020-03-18',11.05],['2020-03-18',11.05],['2020-03-18',11.05],['2020-03-19',11.05],['2020-03-19',11.05],['2020-03-19',11.05],['2020-03-19',11.20],['2020-03-19',10.74],['2020-03-19',10.96],['2020-03-19',11.78],['2020-03-19',11.53],['2020-03-19',12.09],['2020-03-19',12.39],['2020-03-19',12.90],['2020-03-19',12.59],['2020-03-19',12.74],['2020-03-19',12.45],['2020-03-19',12.45],['2020-03-19',12.45],['2020-03-19',12.45],['2020-03-19',12.45],['2020-03-20',12.45],['2020-03-20',13.33],['2020-03-20',12.22],['2020-03-20',12.22],['2020-03-22',12.22],['2020-03-23',12.01],['2020-03-24',13.44],['2020-03-25',13.91],['2020-03-26',14.55],['2020-03-26',14.44],['2020-03-26',14.24],['2020-03-27',13.45],['2020-03-27',13.29],['2020-03-31',13.71],['2020-03-31',14.01],['2020-04-01',14.19],['2020-04-02',15.16],['2020-04-02',15.73],['2020-04-03',15.07],['2020-04-04',15.32],['2020-04-05',15.32],['2020-04-06',15.32],['2020-04-07',16.15],['2020-04-08',16.56],['2020-04-09',17.50]]


São muitos dados; talvez por isso o gráfico tenha louqueado. Se bem que o gráfico deveria de qualquer forma funcionar.

Fiz teste com outro código com poucos códigos, veja no anexo que ficou como esperado.

Se for esse o problema, a solução será limitar os dados. Preciso pensar em como fazer isso.
Anexos
grafico.png
Inacio de Carvalho Neto
cjp
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1138
Data de registro: 19 Nov 2010 21:29
Cidade/Estado: paraná
Curtiu: 6 vezes
Mens.Curtidas: 10 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor ANDRIL » 09 Abr 2020 15:58

O gráfico é para ser um resumo de um relatório, tem que ser compacto, com certeza se colocar muitos dados o resultado não será o esperado. Até porque há um limite para visual das informações que o gráfico pode exibir.

Tente totalizar ou fazer a média por data ou alguma forma a reduzir bastante seus dados. Caso seja inevitável exibir tudo, terá que criar uma paginação para a cada página carregar os dados correspondentes.

Até+
Clipper 5.2e / Blinker 5.1
Harbour 3.0 e 3.2
------------------------
Visitem http://www.nsi-sp.com
Avatar de usuário

ANDRIL
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1160
Data de registro: 06 Jul 2004 00:44
Curtiu: 10 vezes
Mens.Curtidas: 34 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor cjp » 12 Abr 2020 01:26

Estou tentando fazer a mesma coisa com uma outra tabela.
Mesmo com poucos dados, a tabela não está aparecendo. Pode me ajudar?

Segue o código:

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Cadastro realizado com sucesso</title>
    </head>
    <body>
    <?php
    // RECEBENDO OS DADOS PREENCHIDOS DO FORMULÁRIO !
    $peso= $_POST ["peso"];
   
   
   include("conexao.php");

   conectk("","");
     
    $query = "INSERT INTO peso(data,hora,peso) VALUES ('".date('Y-m-d')."','".date('H').":".date('i').":".date('s')."',".$peso.")";
    if (mysql_query($query))
       {echo "Cadastro realizado com sucesso";}
   else
      {echo "Erro";
       echo "<br>";
        echo mysql_error();
       echo "<br>";
      echo $query;
      }
      

$dthoje = date('Y')."-".date('m')."-".date('d');
$dt = date('Y-m-d', strtotime("-7 days",strtotime($dthoje)));

       echo "<br>";
       echo "<br>";
echo $dt;
       echo "<br>";

$sql = "SELECT data,peso FROM peso where data>'".$dt."'";
       echo "<br>";
echo $sql;
       echo "<br>";
$rs=mysql_query($sql);

$obj = "['2020-01-01', 0],";
if (mysql_num_rows($rs)==0){
   $obj.="['Nenhuma data', 0],";
}else{
   while ($l = mysql_fetch_array($rs)){
      $obj.="['".$l['data']."',".$l['peso']."],";
   }
}
$obj = "[".substr($obj,0,strlen($obj)-1)."]";

echo $obj;

      
?>
      

  <html>
  <head>
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">
      google.charts.load('current', {'packages':['corechart']});
      google.charts.setOnLoadCallback(drawChart);
    
      function drawChart() {
        var data = google.visualization.arrayToDataTable(<? echo( $obj ) ?>);
        var options = {
          title: 'Histórico de peso',
          curveType: 'function',
        };

        var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));

        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <div id="curve_chart" style="width: 900px; height: 500px"></div>
  </body>
</html>

      
    <?php
      
echo '<form action="prior2.php"';
// echo "width='59%' style='height:200px;'>";
echo "<br>";
echo "<br>";
echo "<input size='45' style='font-size:180px' type='submit' id='Voltar' value='Voltar ao inicio'>";
echo "</form>";

echo "<br>";
echo "<br>";
echo "<br>";

      
    ?>
    </body>
    </html>
   
   <?

?>


Está resultando assim:

2020-04-12

2020-04-05

SELECT data,peso FROM peso where data>'2020-04-05'
[['2020-01-01', 0],['2020-04-06',86.8],['2020-04-08',87.3],['2020-04-10',83.1],['2020-04-10',83.1],['2020-04-10',83.1],['2020-04-10',83.1],['2020-04-10',83.1],['2020-04-10',83.1],['2020-04-10',83.1],['2020-04-11',87.5],['2020-04-12',83.1],['2020-04-12',83.1]]


Mas o gráfico não aparece.
Inacio de Carvalho Neto
cjp
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1138
Data de registro: 19 Nov 2010 21:29
Cidade/Estado: paraná
Curtiu: 6 vezes
Mens.Curtidas: 10 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor ANDRIL » 13 Abr 2020 09:01

O problema que no seu código está definindo a coluna (cabeçalho) como numérica. Veja na sua linha 49
errado
$obj = "['2020-01-01', 0],";


correto
$obj = "['Data','Cotação'],";


Até+
Clipper 5.2e / Blinker 5.1
Harbour 3.0 e 3.2
------------------------
Visitem http://www.nsi-sp.com
Avatar de usuário

ANDRIL
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1160
Data de registro: 06 Jul 2004 00:44
Curtiu: 10 vezes
Mens.Curtidas: 34 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor cjp » 13 Abr 2020 10:51

Verdade. Achei que devia ser assim por o campo ser numérico na tabela.
Agora deu certo. Muito obrigado.
Inacio de Carvalho Neto
cjp
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1138
Data de registro: 19 Nov 2010 21:29
Cidade/Estado: paraná
Curtiu: 6 vezes
Mens.Curtidas: 10 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor cjp » 14 Abr 2020 00:35

Por favor, mais uma ajuda:

   while ($l = mysql_fetch_array($rs))
   {
      if($1['data']>$dtult)
       {
        $obj.="['".$l['data']."',".$l['peso']."],";
      $dtult=$1['data'];
      }
   }


Neste código, está dando o seguinte erro na linha do if:

Parse error: syntax error, unexpected '1' (T_LNUMBER), expecting variable (T_VARIABLE) or '$' in /home/inaciocarvalho/www/php/peso90d.php on line 135


Não estou entendendo o erro. Pelo que entendi do código que vc havia me passado, $1['data'] deveria retornar o campo data da tabela.

Então, não estaria certo $1['data']>$dtult?

Lembrando que $dtult está definido anteriormente assim:

$dthoje = date('Y')."-".date('m')."-".date('d');
$dt = date('Y-m-d', strtotime("-90 days",strtotime($dthoje)));
$dtult = $dt;
Inacio de Carvalho Neto
cjp
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1138
Data de registro: 19 Nov 2010 21:29
Cidade/Estado: paraná
Curtiu: 6 vezes
Mens.Curtidas: 10 vezes

PHP: exibir gráfico com dados obtidos de uma tabela MySQL

Mensagempor ANDRIL » 14 Abr 2020 07:32

while ($l = mysql_fetch_array($rs))
{
if($1['data']>$dtult)
{
$obj.="['".$l['data']."',".$l['peso']."],";
$dtult=$1['data'];
}
}

Erro de digitação! Trocou a letra 'L' pelo '1' . Corrija
$dtult=$l['data'];
Clipper 5.2e / Blinker 5.1
Harbour 3.0 e 3.2
------------------------
Visitem http://www.nsi-sp.com
Avatar de usuário

ANDRIL
Usuário Nível 5

Usuário Nível 5
 
Mensagens: 1160
Data de registro: 06 Jul 2004 00:44
Curtiu: 10 vezes
Mens.Curtidas: 34 vezes

Próximo



Retornar para Outras linguagens de programação

Quem está online

Usuários vendo este fórum: Nenhum usuário registrado online e 1 visitante


Ola Amigo, espero que meu site e forum tem lhe beneficiado, com exemplos e dicas de programacao.
Entao divulgue o link da Doacao abaixo para seus amigos e redes sociais ou faça uma doacao para o site forum...
MUITO OBRIGADO PELA SUA DOACAO!
Faça uma doação para o forum
cron
v
Olá visitante, seja bem-vindo ao Fórum Clipper On Line!
Efetue o seu login ou faça o seu Registro