PrimeFaces 3.4 图表数据提示格式 [英] PrimeFaces 3.4 Charts datatipFormat

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

问题描述

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

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

我只想将折线图中的值(y 轴)显示为数据提示.像这样:

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.

最好的问候投票

推荐答案

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

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

Highlighter.formatString

我试过了(来自 Primefaces Showcase 的例子):

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"/>

用户豆

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

这个小技巧只是 y 轴显示.

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

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

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