Reputation: 4993
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
<?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...
Upvotes: 2
Views: 5442
Reputation: 1
I'm migrating an application from PrimeFaces 6 to 13 and got a similar error, but the other way around:
<p:chart> Tag Library supports namespace: http://primefaces.org/ui, but no tag was defined for name: chart
PrimeFaces 13 uses separate tags for each type of chart instead of a type attribute. My old syntax (PrimeFaces 6) was
<p:chart type="bar" model="#{chartView.model}"/>
This works in PrimeFaces 13:
<p:barChart model="#{chartView.model}"/>
Upvotes: 0
Reputation: 3610
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
Upvotes: 1
Reputation: 41
The current syntax (5.1) is ...
<p:chart type="line" model="#{chartView.lineModel1}" style="height:300px;"/>
Upvotes: 4
Reputation: 1555
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>
Upvotes: 2