Chart: Gaps in series values and non-uniform intervals

UI Components for JSF
Post Reply
glen_jai
Posts: 5
Joined: 22 Oct 2014, 13:02

23 Oct 2014, 15:21

I am trying to create a line chart of time (x-axis) against value (y-axis) from data that:
- Can contain gaps (no data) for certain intervals.
- Can have non-consistent intervals.

E.g. Data can look like:

(time, value)
(13:00, 3)
(14:00, 10)
(14.30, 5) <--- change of interval here
(15:00, 8)
.... no data here
(18:00, 12)
(18:30, 9)
(19:00, 3)


Note:
Change in interval from 1 hr -> 30 mins from 14:00 onwards.
No data between 15:00 and 18:00.

Is there a way to represent this change in interval and gaps in the series data within a chart?
DateAxis doesn't use time I believe, so don't think I can use it.

Thanks in advance.

Cheers,
Glen :)
Myfaces 2.1, PrimeFaces 5.1, JDK 1.7, Tomcat 7

alfonx
Posts: 93
Joined: 15 Mar 2010, 18:50
Contact:

12 Jan 2015, 11:14

Primefaces 5.1 charts DateAxis is using http://www.jqplot.com/docs/files/plugin ... er-js.html , which seems to support time as far as I can see.

I would try something like:

Code: Select all

series.set("2014-01-01 13:00:00", 3);
series.set("2014-01-01 14:00:00", 10);
series.set("2014-01-01 14:30:00", 5);
series.set("2014-01-01 15:00:00", 8);
series.set("2014-01-01 16:00:00", null);
series.set("2014-01-01 17:00:00", null);
series.set("2014-01-01 18:00:00", 12);
If you need time without a date on the axis, I would try to set the Axis format to just printing the time, not the date.
Greetings,
Steve

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 45 guests