Manorrock.com / Products / Manorrock JSF Chart

Pie Chart

This is an example on how to use the PieChart component.

Simple example

    <chart:pieChart xmlns:chart="http://www.manorrock.com/jsf/chart"
     alt="A pie chart demo" height="300" pieRadius="150" pieX="200" pieY="150"
     value="#{chartBean.pieData}" width="400" />

The example above will take the data from chartBean and display it in a canvas with a width of 400 and a height of 300, and the center of the pie at coordinate (200, 150).

Component attributes

The table below specifies which attributes this component supports.

NameTypeDefaultRequiredDescription
heightjavax.el.ValueExpression (must evaluate to int)300NOThe height of the drawing canvas
pieRadiusjavax.el.ValueExpression (must evaluate to int)150NOThe radius of the pie
pieXjavax.el.ValueExpression (must evaluate to int)200NOThe X coordinate of the center of the pie
pieYjavax.el.ValueExpression (must evaluate to int)150NOThe Y coordinate of the center of the pie
valuejavax.el.ValueExpression (must evaluate to java.lang.Object)NONEYESThe current value of this component
widthjavax.el.ValueExpression (must evaluate to int)400NOThe width of the drawing canvas

Demo

See it in action at our live demo