change legend's font

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
gabbagabbahey
Posts: 10
Joined: Tue Oct 09, 2007 11:12 am

change legend's font

Post by gabbagabbahey » Tue Nov 13, 2007 3:12 pm

How is it possible to change the legend's font easily?

gabbagabbahey
Posts: 10
Joined: Tue Oct 09, 2007 11:12 am

no solution to this?

Post by gabbagabbahey » Wed Nov 14, 2007 8:56 am

i tried the following -
chart.getLegend().setItemFont(new java.awt.Font("SansSerif",0,20));

But it doesn't work :(

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Nov 14, 2007 11:15 am

That works for me. Perhaps you could post a small self-contained demo that reproduces the problem.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

gabbagabbahey
Posts: 10
Joined: Tue Oct 09, 2007 11:12 am

Only works on Multiple Pie Chart

Post by gabbagabbahey » Wed Nov 14, 2007 6:23 pm

var chart = plot.getPieChart();
chart.getLegend().setItemFont(new java.awt.Font("SansSerif",0,20));

The above will work for Multiple Pie Chart. It will set the individual legend's font, but how do i change the overall legend's font?

Locked