Hello,
Is it possible to change the size (width and height) of the legend from a chart (i.e. TimeSeriesChart)?
And if there is a possibility, can you tell me, how can I resize the legend.
Many thanks
Bernd
Resize the legend
Re: Resize the legend
Hi Bernd,
The legend size is automatic...about all you can do to change the size is to change the font (setItemFont(...)) to a different size. And keep your series names short if you are trying to save space.
Apart from that, you can set the legend to null (saves space but isn't always helpful) or write a new legend class (the current one is due for an overhaul, but there is so much to do and so little time).
Regards,
DG.
The legend size is automatic...about all you can do to change the size is to change the font (setItemFont(...)) to a different size. And keep your series names short if you are trying to save space.
Apart from that, you can set the legend to null (saves space but isn't always helpful) or write a new legend class (the current one is due for an overhaul, but there is so much to do and so little time).
Regards,
DG.
Re: Resize the legend
Hi David,
thanks for your answer. But I don't know, how can I use setItemFont(...) to change the fontsize. Can you give me a short Codepart to understand this.
Many thanks
Bernd
thanks for your answer. But I don't know, how can I use setItemFont(...) to change the fontsize. Can you give me a short Codepart to understand this.
Many thanks
Bernd
Re: Resize the legend
It would be something like:
StandardLegend legend = (StandardLegend)myChart.getLegend();
Font font = new Font("Serif", Font.PLAIN,
;
legend.setItemFont(font);
Regards,
DG.
StandardLegend legend = (StandardLegend)myChart.getLegend();
Font font = new Font("Serif", Font.PLAIN,

legend.setItemFont(font);
Regards,
DG.
Re: Resize the legend
Hi David,
thank you for your help. It works excellent.
Regards,
Bernd
thank you for your help. It works excellent.
Regards,
Bernd