Home forums Using CanvasJS datetime picker to dispaly a chart containing values from oracle database Reply To: datetime picker to dispaly a chart containing values from oracle database

#26156

In this “Please take a look at this Sample Project.” as mentioned by you earlier , if I provide a string/date value in the code : a blank screen with no data comes . Data only in double format is picking up to render the chart which is not proper.
String sql = ” SELECT * from Fan2TempMotorBearing where rownum < 50 order by datetime”;
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery(sql);

while (rset.next()) {
Date xVal =rset.getDate(“datetime”);// Date values
double y1Val = (double)rset.getDouble(“y_actual”), y2Val = (double)rset.getDouble(“y_predicted”);

map = new HashMap<Object,Object>(); map.put(“x”, xVal); map.put(“y”, y1Val); list1.add(map);
dataPoints1 = gsonObj.toJson(list1);

map = new HashMap<Object,Object>(); map.put(“x”, xVal); map.put(“y”, y2Val); list2.add(map);
dataPoints2 = gsonObj.toJson(list2);
}
}

Query:
create table Fan2TempMotorBearing (datetime date , y_actual float(50), y_predicted float(50))
insert into Fan2TempMotorBearing values (TO_DATE(‘2018-07-01 00-00-00′,’yyyy-mm-dd hh24-mi-ss’),’50.183′,’53.0519169458035′)
insert into Fan2TempMotorBearing values (TO_DATE(‘2018-07-01 00-05-00′,’yyyy-mm-dd hh24-mi-ss’),’50.183′,’53.0261445540871′)

kindly check for this if possible why only double parameters can plot the graph from database and not string / date type data.