A somewhat common request for people working with the charts API in JavaFX is a DateAxis. Essentially that would be an Axis that would be able to show dates.

I’ve hacked up a quick implementation of one, you can get it from github: https://github.com/dukke/FXCharts

It takes the time value of dates and displays them using the format given defined by “TICK_UNIT_FORMATTER_DEFAULTS”.

It’s not really a very elegant solution but it works. I’ll try to give a hand to Diego Cirujano-Cuesta and Christian Schudt who are working in a more evolved DateAxis that takes up Dates instead of their time value.

This implementation was done under Java8. It might work with JavaFX 2.2, I don’t know.

5 thoughts on “DateAxis for javafx

  1. Java desktop links of the week, September 9 « Jonathan Giles

  2. JavaFX links of the week, September 9 // JavaFX News, Demos and Insight // FX Experience

  3. Hi Pedro, How are you, I like too much your solution Dateaxis for linechart, and I’m trying to implement in java project that I’m developing in Brazil. But I tried implements how Library and I could’nt other way that i’m working now is save the code as a class in my project. I’m working with Netbeans IDE 8.2 and my IDE is not recognizing the line 302. ReadOnlyDoubleWrapper scalePropertyImplValue = (ReadOnlyDoubleWrapper) ReflectionUtils.forceMethodCall(ValueAxis.class, “scalePropertyImpl”, this); specify the methods ReflectionUtils. and i don’t find one import that work this function. I’m very beginer in java, and my english maybe is not very well. But I would be very grateful if you could give me a hint to make this work. I don’t know if it’s just a question of version because I see that your post is from 2013 and I’m working on 2020 or something deeper. Since already very grateful

    • Hi Jenilson,

      Thanks. I’m glad you like it!

      Since that’s a Java question, it’s better to ask it on stackoverflow or some other site dedicated to answering general questions or Java questions.


Leave a Reply

Your email address will not be published. Required fields are marked *