Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

today I wanted to try the new PrimeFaces release 3.4.RC1. For charts there is a new attribute called datatipFormat.

I want to show only the value (y-axis) in a line chart as datatip. Like this:

<p:lineChart value="#{...}" datatipFormat="y-value"/>

What do I have to do to show only this? I could not find an example with a template String.

Best Regards Veote

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
84 views
Welcome To Ask or Share your Answers For Others

1 Answer

Primefaces uses a jqPlot Library for Charts. There I found the following entry:

Highlighter.formatString

I tried (example from Primefaces Showcase):

   <p:lineChart  id="basic" value="#{userBean.categoryModel}" legendPosition="ne" 
   datatipFormat="#{userBean.datatipFormat}"  title="Basic Bar Chart" min="0"
    max="200" style="height:300px"/>

UserBean

public String getDatatipFormat(){
   return "<span style="display:none;">%s</span><span>%s</span>";
}

and with this little trick is only y-axis displays.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...