Problems with visualisation in Chrome

Hello,

 

I just upgraded to the latest version of emoncms.

Now I'm not able to the see any data in a chart anymore with Google Chrome. I only get an empty grid.

In Safari and IE the visualisation seems to work - except the Multigraph (here I don't even get an empty grid).

Is this a problem of my installation (I already set up a new installation - without upgrading from an older version) or could it be a bug in the latest version?

regards,

hb

 

Lloyd's picture

Re: Problems with visualisation in Chrome

 Have you tried with the demo site (http://vis.openenergymonitor.org/)?  I think that is the latest version, and with a brief look it works for me with Chrome.

Lloyd

hirschbrat's picture

Re: Problems with visualisation in Chrome

 Yes, I tried the demo site and it works with chrome. However, the GUI of the demo site looks quite different compared to the latest master branch from github that is running on my system.

Lloyd's picture

Re: Problems with visualisation in Chrome

 Have sent you a PM with a link to my site under development) which works with chrome.  I don't know if it is the very latest version, but it is not that old.

Lloyd

TrystanLea's picture

Re: Problems with visualisation in Chrome

Hello Lloyd, hb, yes sorry about the multigraph problem my error, I have fixed the problem so it should work now.

The lastest version is available here: https://github.com/openenergymonitor/emoncms3 both master and dev branches are the same at the moment. Also the new version hosted site is here: http://emoncms.org rather than vis.openenergymonitor.org which is the old version.

hirschbrat's picture

Re: Problems with visualisation in Chrome

 Hello TrystanLea,

the multigraph works now for me (but not in Chrome).

I've tried to figure out why there is no data plotted with Chrome in my setup. I looked at the JavaScript request to get the data from the database and tested this manually in Chrome and Safari. While the same URL works in Safari I get the following error in Chrome:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '92 AND `time` <1342374061,72 LIMIT 1' at line 1

1.Exaple URL: <SERVER>/emon/feed/data.json?&apikey=&id=1&start=1342373456920&end=1342978256920&dp=1000

If I set the last 3 number of each timestamps in the URL to zero and choose a smaller dp of 900 I get the data from the database with Chrome too.

2.Exaple URL: <SERVER>/emon/feed/data.json?&apikey=&id=1&start=1342373456000&end=1342978256000&dp=900

Pherhaps you have an idea what's wrong here. I haven't had this problem before with an older version.

 

hirschbrat's picture

Re: Problems with visualisation in Chrome

 The SQL query seems to have a problem with the decimal delimiter of the timestamp in some cases.

I changed the following code in the function "get_feed_data()" in the feed_model.php file:

 OLD:    $start = $start/1000; $end = $end/1000;

 NEW:   $start = round($start/1000); $end = round($end/1000);
 
AND
 
OLD:    $td = $range / $dp;
NEW:   $td = round($range / $dp);
 
These changes may also be done in the function get_histogram_data().
 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.