text « Legend « JFreeChart Q&A

1. How do update the text of a legend item?    jfree.org

I am using time series. I am trying to : 1. static class CustomizedStandardXYSeriesLabelGenerator extends StandardXYSeriesLabelGenerator { private static final long serialVersionUID = 1L; TimeSeriesCollection xydataset; CustomizedStandardXYSeriesLabelGenerator(TimeSeriesCollection xydataset) { this.xydataset = xydataset; } public String generateItemLabel(int series){ return this.xydataset.getSeries(series).getDescription(); } } 2. //set the customized legend label generator renderer.setLegendItemLabelGenerator(new CustomizedStandardXYSeriesLabelGenerator(xydataset)); where "xydataset" is an object of "TimeSeriesCollection" 3. xydataset.getSeries(2*attackTypes.length).setDescription("Before Filtering"); then ...

2. Legend's Text display a strip    jfree.org

I am still not sure what you problem is! Do I get you right that the image created from the chart looks ok, but if you embed the image in a pdf, the image is wrong? Then something is wrong with the way you embed the image. Do you have some sample code?