dqask02082 2016-10-09 15:29
浏览 151
已采纳

从mysql获取数据并绘制图表

I have a temperature logger that stores a float value in mysql database, with the time and date of reading. Now I would like to use highcharts and display the values instead of in a table in a chart.

I have found an example on http://blueflame-software.com/using-highcharts-with-php-and-mysql/, but when I set my values I get this:

enter image description here

When I was getting through the code I have noticed difference in date and time format (format that I am using yyyy-mm-dd hh:mm:ss). I have changed the line

  date= Date.pars(line[0]+ ' ISO');

but no luck.

  • 写回答

2条回答 默认 最新

  • duangou2046 2016-10-09 15:59
    关注

    Convert the datetime format in your data.php.

    $t = date_create(line[0]);
    echo date_format($t, 'l, F j, Y H:i:s');
    

    This should return something like this:

    Tuesday, May 3, 2016 10:00:00
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 CSS实现渐隐虚线边框
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题