3 Replies Latest reply: Oct 8, 2012 11:33 AM by James_D RSS

    Charts - DateAxis? Or how to implement custom axes?

    csh
      Hi,

      I need to visualize data in a chart.

      The data consists of a Date and an Integer.

      Obviously there is no DateAxis in JavaFX.

      Do you have any idea how to approach this problem?

      Sample Data could be:
      Map<Date, Integer> map = new HashMap<Date, Integer>();
      
      map.put(new GregorianCalendar(2010, 1, 1).getTime(), 77);
      map.put(new GregorianCalendar(2011, 1, 1).getTime(), 11);
      map.put(new GregorianCalendar(2011, 6, 1).getTime(), 23);
      map.put(new GregorianCalendar(2012, 1, 1).getTime(), 45);
      I guess I have to create my own axis and extend from Axis<Date>.

      But without proper documentation/sample it is hard to implement all those abstract methods correctly.