series: [
{
name : 'dns hits',
data: ([
<% @HighStock_result.each{ |row| %>
[Date.UTC(<%=row['qt']%>),<%=row['hits']%>],
<%}%>
])
}
]
Get time from Psql to Highstock
-
15-07-2023 - |
Domanda
I am trying to get time from postgresql database to Highstock series, so in my series I put that code :
series: [{
name: "DNS hits",
data: [
<%
@HighStock_result.each{ |row|
%>
[Date.UTC(<%= row["query_time"] %>)],
<%}%>
],
}]
in my database I have column query_time type timestamp without time zone, the format of time is like this :
2014-04-30 11:01:55
2014-04-30 11:01:56
2014-04-30 11:01:56
2014-04-30 11:01:57
So when run this I have a javascript error :
Horodatage : 05/05/2014 11:28:53
Erreur : SyntaxError: missing ) after argument list
Fichier Source : http://192.168.111.136:3000/assets/js/lib/all-concat.js?body=1
Ligne : 1909, Colonne : 25
Code Source :
[Date.UTC(2014-04-30 11:01:55)],
any suggestions would be greatly appreciated. Thank you in advance.
Soluzione 2
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow