my problem is: I'm doing a chart and have it to put the time of day in any axis, so there is a comparison that the rest of the result of the database(mysql) that I will receive. The problem is that I am not getting put this hour, not by the 'data set' or in any other way. Can you help me? I will be very grateful!
I'll put a picture below, more or less what I want. How is the image 0-24 in hours. Thank you all. ![enter image description here][1]
Create a computed column in the dataset with data-type Integer and an expression such:
var formatter = new java.text.SimpleDateFormat("HH");
row["mydate"]!=null?Number(formatter.format(row["mydate"])):-1;
where "mydate" is of course the name of the dataset field on which hours of days should be based. Then, use this computed column as x-axis of the chart. Notice in this example, possible null values are grouped on a fictive -1 hour number.
If you handle large volumes of data, then you can optimize this by creating the formatter as a global variable in "beforeOpen" method of the dataset.