PrimeFaces 3.4图表datatipFormat [英] PrimeFaces 3.4 Charts datatipFormat

查看:387
本文介绍了PrimeFaces 3.4图表datatipFormat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我想尝试新的PrimeFaces版本3.4.RC1。
对于图表,有一个称为datatipFormat的新属性。



我想在线形图中只显示值(y轴)为datatip。
像这样:

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

我该怎么做只显示这个?
我找不到模板String的示例。



最好的问候
Veote

解决方案

Primefaces使用jqPlot库作为图表。在那里我找到了以下条目:



Highlighter.formatString



我尝试了(来自Primefaces Showcase的示例):

 < p:lineChart id =basicvalue =#{userBean.categoryModel}legendPosition =ne
datatipFormat =#{userBean.datatipFormat}title =基本条形图min =0
max =200style =height:300px/>

UserBean

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

这个小技巧只有y轴显示。

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

解决方案

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.

这篇关于PrimeFaces 3.4图表datatipFormat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆