I have created MultiLine chart and one of the seriesName is too large say lenegth will be 500 charcters or more. But the chart area is 350*350. So some of the tailing seriesName characters in the Legends part are not visible. How to make the word wrap for the legends. If seriesName reached the chart area width, it will write into next line, so that all the characters to be visible.
My Sample code base is as follows,
Code: Select all
XYSeries series1 = new XYSeries(" Ravikumar R, Software Development Private Limited, Sarathy Nagar, Anna Nagar, Chennai -4, India. contact me @ ravikumar@gmail.com ");
series1.add(1.0,2.0);
series1.add(2.0,5.0);
series1.add(3.0,7.0);
series1.add(4.0,8.0);
series1.add(5.0,9.0);
series1.add(6.0,9.0);
XYSeries series2 = new XYSeries("Ramesh R, Compute Network Development Private Limited, Tharamani, Velachery, Chennai -42");
series2.add(1.0,3.0);
series2.add(2.0,7.0);
series2.add(3.0,8.0);
series2.add(4.0,8.0);
series2.add(5.0,10.0);
XYSeriesCollection dataset = new XYSeriesCollection();
dataset.addSeries(series1);
dataset.addSeries(series2);
JFreeChart chart = ChartFactory.createXYLineChart("Company Details","CompanyName","count",dataset,PlotOrientation.VERTICAL,true,true,false);
How to make the whole content to be shown in the legends without changing the chart area.
I am appreciate the early response.
Thanks & Regards
R.Ravikumar