How to mask a legend ?

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

How to mask a legend ?

Post by lonelyplanetfr » Sat Nov 24, 2001 11:37 am

Hello

I would like to mask the legend in a chart (in a verticalbarchart)
There is no problem by using the instruction

myChart.setLegend(null)


But (!)
I would like to use the ui to change properties
Ik there is no legend, i get a NullPointerException in legendEditPropertiesPanel

I tried to intercept it, but it doesn't work
So I tried to create another legend (Legend.createInstance) to give as agument in the constructor of the panel , but it doesn't work


Do U know how to do ?

Thanks



PS: maybe there is a easier way like Legend.setVisible = false but I did'nt find it

David Gilbert

RE: How to mask a legend ?

Post by David Gilbert » Mon Nov 26, 2001 9:27 am

You are doing the right thing with:

chart.setLegend(null);

It is a bug that the property editor subsequently throws an exception. I was actually working on the fix the other day, but got distracted before I completed the job. I'll get back to it this week and make sure it is fixed for the next release.

Regards,

DG.

Locked