Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Invient charts Time data with irregular intervals
I would like to create a graph with :
- Date as X axis
- Value as Y axis.
I have to display three curves on the same graphes.
The dates are not following a sequence.
For example, I have :
Graph One : [01/01/2012, 100.00], [01/02/2012, 105.00], [01/06/2012, 110.00]
Graph Two : [01/02/2012, 100.00], [01/03/2012, 105.00], [01/05/2012, 110.00]
Graph Three: [02/02/2012, 100.00], [02/03/2012, 105.00], [31/05/2012, 110.00], 01/06/2012, 102.00]
So, the "X axis" does not present a sequence for the date.
All the curves do not have the same X axis values.
All the graphes do not contain the same number of point.
I saw a lot of examples with datetime axis, but this axis relies on sequentials values (starting point + frequency (every day, week, ...)).
I would like to have an axis like the one described here before.
Did someone already encounter this kind of request ,
Thanks in advance
did you find a workaround for this?
What I did has been to set those Dates out of the intervals with values to 'null'. due to the fact that DateTimePoint class has method setY defined as private, I have gone directly to the field 'y'.
DateTimePoint mtp = new DateTimePoint(.......etc...); Field fieldY = mtp.getClass().getDeclaredField("y"); fieldY.setAccessible(true); fieldY.set(mtp, null);
In this way the chart is properly displayed.