Dear Sir,
Can anyone tell me how to change category label? I want to change from category1, category2...to Number1...number2.....I did search the doc before...something about Default....(String[],Object[][], data) constructor. However, I can't find this class?? Therefore, I hope someone give a hand, please...thanx a lot
How to change Category Label?
Re: How to change Category Label?
Hi Jason,
Take a look through the methods in the DefaultCategoryDataset class. It's in the JCommon class library, which you can download from:
http://www.object-refinery.com/jcommon/index.html
JFreeChart includes the JCommon runtime jar file, but not the source code.
There's a method setCategories(...) in that dataset, to which you pass an array of Objects (make sure it is the same number of objects as categories). Or you can specify the categories in the constructor. The toString() method is used to convert each category object to a label on the chart.
Regards,
Dave Gilbert
Take a look through the methods in the DefaultCategoryDataset class. It's in the JCommon class library, which you can download from:
http://www.object-refinery.com/jcommon/index.html
JFreeChart includes the JCommon runtime jar file, but not the source code.
There's a method setCategories(...) in that dataset, to which you pass an array of Objects (make sure it is the same number of objects as categories). Or you can specify the categories in the constructor. The toString() method is used to convert each category object to a label on the chart.
Regards,
Dave Gilbert