Simple Java bean:
@ManagedBean
@RequestScoped
public class
LineChartBean {
protected
List<Integer> simpleList;
public
List<Integer> getSimpleList() {
return
simpleList;
}
public
LineChartBean() {
reload();
}
private
void reload() {
simpleList
= new ArrayList<>();
Random
r = new Random();
for
(int i = 2000; i < 2010; i++) {
simpleList.add(r.nextInt(500)
+ 800);
}
}
}
JSF page:
<hf:chart
type="line" value="# {lineChartBean.simpleList}" var="point"
point="#
{point}" title="List of Integer values" xaxisLabel="Index"
yaxisLabel="Amount"/>
Output:
Easy to install:
New versions
are submitted to Maven Central, so you can easily add it to your maven based
projects:
<dependency>
<groupId>org.highfaces</groupId>
<artifactId>highfaces</artifactId>
<version>${project.version}</version>
</dependency>
HighFaces
source code including the showcase can be found at here
Bugs
and Feature Requests can be submitted here.
Enjoy!
Niciun comentariu :
Trimiteți un comentariu