1
votes

i want to create a linechart using primefaces 5.1. but i got error message " Tag Library supports namespace: http://primefaces.org/ui, but no tag was defined for name: lineChart " when loading my xhtml page. this is my code

sample.xhtml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>
<h:body>
<h:form>

 <p>LineChart is created By Manaf.</p>
    <p:lineChart id="linear" value="#{chartBean.linearModel}" legendPosition="e"          title="Linear Chart" minY="0" maxY="10" style="height:300px;"/>
    <p:lineChart id="category" value="#{chartBean.categoryModel}" legendPosition="e"title="Category Chart" minY="0" maxY="200" tyle="height:300px;margin-top:20px"/>

</h:form>
</h:body>
</html>

... what is the actual problem, iam a beginner in primefaces and jsf...

3

3 Answers

3
votes

The current syntax (5.1) is ...

<p:chart type="line" model="#{chartView.lineModel1}" style="height:300px;"/>
2
votes

Check if you use latest version currently it 5.1. Visit PrimeFaces or check Maven dependency:

<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>5.1</version>
</dependency>
1
votes

According to the documentation of primefaces 6.2:

https://www.primefaces.org/docs/guide/primefaces_user_guide_6_2.pdf

 <p:chart type="line" model="#{bean.model}" />

These are the different types that exist, and also each one can be customized or combined several

enter image description here