Changing the Category and Value to different names

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Navin Pathuru

Changing the Category and Value to different names

Post by Navin Pathuru » Tue May 29, 2001 6:10 pm

Hello, This may be a simple question that i am posting. I have downloaded the JFreeChart and i was able to play with it without any problem. It is undoubtedly a very good tool. I have faced one problem, when i tried to change the labels on X-Axis which is "Category", i was unsuccessful. I have looked in the super classes of the JFreeChartDemo and it was setting the labels in the class "DefaultCategory*" ( i forgot the name of the class but it starts with "DefaultCategor**" ). I have set it to different names here. After doing this i compile and run it and i am continuosly noticing that although i give it different names it is setting back to the same name "Categroy". I also put break points and i inspected certain objects and i am seeing this happening. Can any one pour some light if there is a way i could change the labels to Customized names.
Thank you.
Sincerely,
Navin.

Pedro Garcia Haro

RE: Changing the Category and Value to different n

Post by Pedro Garcia Haro » Tue May 29, 2001 6:24 pm

Hi Navin, to custimizing you X-Axis labels to put your own categories, you must to use this constructor.
DefaultCategoryDataSource(String[] seriesNames, Object[] categories, Number[][] data) {

This means that you musto to have the labels for Categories in an Object Array.
And then call DefaultCategoryDataSource(String[] seriesNAmes={"SERIE"}, myCategory, data);

Locked