Question

Have set with data, where object represent service with min time, max time, avg time and name of service. Need to show this set by category bar chart, where category is name of service. But main problem in: How to make range axis in this chart to show time like (... hourse ... min)?

Was it helpful?

Solution

You can't mix DateAxis (a specialization of ValueAxis) with CategoryAxis. If you want to do something like

enter image description here

Your only choice is to define your parent category with the name of the category and then add subcategories with customized labels in order to show formatted dates or whatever you want.

If you want to write dates use this ( http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html) to format the string

See the example here:

https://code.google.com/p/swing-ui-hxzon/source/browse/trunk/jfreechart/org/jfree/chart/demo/SubCategoryAxisDemo1.java?spec=svn67&r=67

OTHER TIPS

Use classes from org.jfree.data.time package . Find example here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top