DefaultCategoryDataset.setValue

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

DefaultCategoryDataset.setValue

Post by sido » Mon Apr 08, 2002 9:22 am

hi,

i am using the JFreechart to draw some graphics, and i need the DefaultCategoryDataset.setValue, but i get an error:

javax.servlet.ServletException: DefaultCategoryDataset.setValue: unrecognised category.

but i don't really understand what are the "categories",

thanks for help,
sido.

David Gilbert

Re: DefaultCategoryDataset.setValue

Post by David Gilbert » Mon Apr 08, 2002 9:29 am

Each value in a series is associated with a category. Each category can be represented by any instance of java.lang.Object (that is, any object you like), though most of the time using the String class is easiest. If you don't specify the categories in the constructor for DefaultCategoryDataset then a set of default categories will be created for you: "Category 1", "Category 2", ... , "Category n".

The set(...) method is intended for updating existing values, so you need to specify the series and category and the new value.

Regards,

DG.

Locked