Pie Chart Label

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

Pie Chart Label

Post by Don Mitchell » Mon Jan 20, 2003 10:51 pm

Two questions for when you have multiple categories and series:

1. I modified the placement of the Pie label so that it won't overwrite the individual slice labels. I did this by placing it 2 times the font height below the pie:

double labelY = pieY + pieH + 2 * bounds.getHeight();

I was hoping this could get added into the next release.

2. I know in the next release the CategoryDateset will be replaced by a TableDataset. Will this change the way multiple pies are displayed when you have multiple categories and series? I posted about this once before, that there is an inconsistency between how this is displayed with multiple pies and how it gets displayed with bar charts (or line charts). Basically I want each category to have it's own pie, instead of each series. I have a chart with one category with several series. In a pie chart this is rendered has serveral pies all set to 100% for the one category.

thanks,
Don

David Gilbert

Re: Pie Chart Label

Post by David Gilbert » Wed Jan 22, 2003 5:10 pm

Don Mitchell wrote:
> 1. I modified the placement of the Pie label so that it won't
> overwrite the individual slice labels. I did this by placing
> it 2 times the font height below the pie:
>
> double labelY = pieY + pieH + 2 * bounds.getHeight();
>
> I was hoping this could get added into the next release.

That makes sense...I'll try to incorporate it.

> 2. I know in the next release the CategoryDateset will be
> replaced by a TableDataset. Will this change the way
> multiple pies are displayed when you have multiple categories
> and series? I posted about this once before, that there is
> an inconsistency between how this is displayed with multiple
> pies and how it gets displayed with bar charts (or line
> charts). Basically I want each category to have it's own
> pie, instead of each series. I have a chart with one
> category with several series. In a pie chart this is
> rendered has serveral pies all set to 100% for the one
> category.

I changed from CategoryDataset to TableDataset and made some significant API changes...now I've reverted the name back to CategoryDataset, but the API changes remain.

Before, categories were accessed using an Object key, and series were accessed using an int. Now, it is just rows and columns, with each being accessible by index (int) or key (Comparable). This should make it much simpler to transpose a dataset, so it shouldn't be difficult to resolve the inconsistency that you reported previously.

Regards,

Dave Gilbert

Locked