Adding a custom legend

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
the_schmitz
Posts: 13
Joined: Thu May 18, 2006 6:01 pm
Location: Washington DC

Adding a custom legend

Post by the_schmitz » Fri May 26, 2006 1:34 pm

Hi There,
I've created an application that has a JTable in which a user can filter data in/out. Once they have filtered the data (which they really don't have to do with a small dataset), they can generate different types of charts with an XYDataset.

Everything looks fine, but the client would like to have a legend added to the chart that will display what data has filtered.

For instance, if I have a Table with first_name, last_name, age, height, weight, and I'm chartting on age, height, and weight, and having the series broken up by first_name, but I'm filtering on only last_name="Jones", then the chart should appear with the default legend, and an additional legend displaying "Last Name = 'Jones'" Or something to that effect.

Is that possible? And how do I go about doing that? I can't seem to find a function call that will enable me to do that. I've only found calls that enable me to modify the default legend. And even with those ones, I can't find a call that allows me to put in custom text.

Any help is appreciated
Chris

the_schmitz
Posts: 13
Joined: Thu May 18, 2006 6:01 pm
Location: Washington DC

So,.. ummm,.. not possible?

Post by the_schmitz » Fri Jun 02, 2006 7:19 pm

So,.. I take it this isn't possible? :(

Can anyone tell me if a feature like this might be implemented in the future? I could definatly see the benefits of something like this, and I'm a little surprised it's not there. ARG!

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Fri Jun 02, 2006 8:07 pm

What happens if you call

Code: Select all

public void addLegend(LegendTitle legend)

Locked