org.zkoss.zkex.zul.impl
Class JFreeChartEngine

java.lang.Object
  extended by org.zkoss.zkex.zul.impl.JFreeChartEngine
All Implemented Interfaces:
java.io.Serializable, ChartEngine

public class JFreeChartEngine
extends java.lang.Object
implements ChartEngine, java.io.Serializable

A chart engine implemented with JFreeChart.

Available in ZK PE and ZK EE.

This is the JFreeChart base chart engine implementation. All chart would support drilldown by providing Area hot spots. Each Area would callback to ChartAreaListener class that application developers can do processing on each area.

Note that useful ChartModel information is put in Area's custom attribute Map so you can retrieve them by calling Area's getAttribute(key) method and use them in drilldown function. Following is the table of keys for different ChartModel.

modelkey
PieModelentity
category
value
CategoryModelentity
series
category
value
XYModelentity
series
x
y
XYZModelentity
since 3.5.0series
x
y
z
HiLoModelentity
series
date
open
high
low
close
volumn

Following is the explanation for each key:

See also jFreeChart.

Since:
3.0.0
Author:
henrichen
See Also:
Serialized Form

Constructor Summary
JFreeChartEngine()
           
 
Method Summary
 byte[] drawChart(java.lang.Object data)
          Draw the chart and render into image format as an byte array.
protected  java.lang.String getGanttTaskTooltip(java.util.Date start, java.util.Date end, java.lang.Number percent)
          Returns data tooltiptext of the GanttTask.
protected  boolean prepareJFreeChart(org.jfree.chart.JFreeChart jfchart, Chart chart)
          Developers with special needs can override this method to apply own rendering properties on the created JFreeChart.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JFreeChartEngine

public JFreeChartEngine()
Method Detail

prepareJFreeChart

protected boolean prepareJFreeChart(org.jfree.chart.JFreeChart jfchart,
                                    Chart chart)
Developers with special needs can override this method to apply own rendering properties on the created JFreeChart. The original implementation of this method simply return false to tell the engine to apply its default rendering properties. Return true tells the engine NOT to apply its default rendering properties.

Parameters:
jfchart - the created JFreeChart
chart - the ZK chart component associated with this ChartEngine.
Returns:
true to tell this engine NOT to apply its default rendering properties; false to tell this engine TO apply its default rendering properties.
Since:
3.0.1

drawChart

public byte[] drawChart(java.lang.Object data)
Description copied from interface: ChartEngine
Draw the chart and render into image format as an byte array.

Specified by:
drawChart in interface ChartEngine
Parameters:
data - the data used in drawing a chart; depends on implementation.

getGanttTaskTooltip

protected java.lang.String getGanttTaskTooltip(java.util.Date start,
                                               java.util.Date end,
                                               java.lang.Number percent)
Returns data tooltiptext of the GanttTask.

Parameters:
start - the starting date
end - the ending date
percent - the complete percentage
Returns:
data tooltiptext of the GanttTask.


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo