com.googlecode.wickedcharts.wicket6.highcharts.features.basic
Class ChartBehavior

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by com.googlecode.wickedcharts.wicket6.highcharts.features.basic.ChartBehavior
All Implemented Interfaces:
Serializable, org.apache.wicket.IComponentAwareEventSink, org.apache.wicket.markup.html.IComponentAwareHeaderContributor, org.apache.wicket.util.io.IClusterable

public class ChartBehavior
extends org.apache.wicket.behavior.Behavior

This behavior takes in an Options object containing the configuration of a chart and calls the proper javascript to display the chart in the component to which this behavior is added.

Author:
Tom Hombergs (tom.hombergs@gmail.com)
See Also:
Serialized Form

Constructor Summary
ChartBehavior(Chart container)
          Constructor.
 
Method Summary
protected  void includeChartJavascript(org.apache.wicket.markup.head.IHeaderResponse response, Options options, JsonRenderer renderer, String markupId)
          Includes the javascript that calls the Highcharts library to visualize the chart.
 void onConfigure(org.apache.wicket.Component component)
           
 void renderHead(org.apache.wicket.Component component, org.apache.wicket.markup.head.IHeaderResponse response)
           
 
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, bind, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onComponentTag, onEvent, onException, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartBehavior

public ChartBehavior(Chart container)
Constructor.

Parameters:
options - the options for the chart. The Option class is very similar in structure to the Highcharts API reference, see http://www.highcharts.com/ref/.
Method Detail

includeChartJavascript

protected void includeChartJavascript(org.apache.wicket.markup.head.IHeaderResponse response,
                                      Options options,
                                      JsonRenderer renderer,
                                      String markupId)
Includes the javascript that calls the Highcharts library to visualize the chart.

Parameters:
response - the Wicket HeaderResponse
options - the options containing the data to display
renderer - the JsonRenderer responsible for rendering the options
markupId - the DOM ID of the chart component.

onConfigure

public void onConfigure(org.apache.wicket.Component component)
Overrides:
onConfigure in class org.apache.wicket.behavior.Behavior

renderHead

public void renderHead(org.apache.wicket.Component component,
                       org.apache.wicket.markup.head.IHeaderResponse response)
Specified by:
renderHead in interface org.apache.wicket.markup.html.IComponentAwareHeaderContributor
Overrides:
renderHead in class org.apache.wicket.behavior.Behavior


Copyright © 2013. All Rights Reserved.