1 22 23 package de.laures.cewolf.example; 24 25 import java.io.Serializable ; 26 import java.util.Map ; 27 28 import org.jfree.chart.JFreeChart; 29 import org.jfree.chart.title.TextTitle; 30 31 import de.laures.cewolf.ChartPostProcessor; 32 33 37 public class ExtraTitleEnhancer implements ChartPostProcessor, Serializable { 38 39 40 public ExtraTitleEnhancer() { 41 } 42 43 public void processChart(Object chart, Map params) { 44 String title = (String )params.get("title"); 45 if (title != null && title.trim().length() > 0) { 46 ((JFreeChart)chart).addSubtitle(new TextTitle(title)); 47 } 48 } 49 50 } 51 | Popular Tags |