/*	PieChartEngine.java

	Purpose:
		
	Description:
		
	History:
		Oct 18, 2010 2:27:40 PM     2010, Created by henrichen

	Copyright (C) 2010 Potix Corporation. All Rights Reserved.
*/

package org.zkoss.zssex.util;

import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PiePlot;
import org.zkoss.poi.ss.usermodel.ChartInfo;
import org.zkoss.zss.model.SChart;
import org.zkoss.zul.Chart;

/**
 * A PieChartEngine customized to draw Line Chart for matching Excel pie chart style
 * 
 * @author henrichen@zkoss.org
 * @author dennis , refine to new chart model
 */
public class PieChartEngine extends ZssChartEngine {
	private static final long serialVersionUID = 201011011426L;
	public PieChartEngine(SChart chartInfo) {
		super(chartInfo);
	}
	public boolean prepareJFreeChart(JFreeChart jfchart, Chart chart) {
		super.prepareJFreeChart(jfchart, chart);
		final PiePlot plot = (PiePlot) jfchart.getPlot();
		plot.setLabelGenerator(null); //do not generate link label around Pie chart
		return false;
	}
}