如何使用primefaces + jqplot水平条形图中添加的垂直线(How to add a v

2019-10-22 08:44发布

我使用primefaces + jqplot以创建水平和堆积条形图:

代码(实施例 - Primefaces):

http://www.primefaces.org/showcase/ui/chart/bar.xhtml

我需要在图表中添加一行这样的形象:(红色线垂直)

http://peltiertech.com/Excel/pix1/AddLine.gif

我能做到这一点与Primefaces + Jqplot? 如果有可能,有人可以帮我明白了吗?

Answer 1:

最后,解决我的问题:

1 - 在托管Bean添加扩展与延伸的名称:

 horizontalBarModel.setExtender("NAME");

2 - 创建XHTML的JavaScript函数:

function NAME(){}

3 - 添加一个帆布覆盖:

function NAME()
{
 this.cfg.canvasOverlay = {
                show: true,
                objects: [{verticalLine:{
                "shadow":"false",
                "lineWidth":5,
                "color":"rgb(255,0,0)",
                "x":50 
 }}]};

}

4 - 该垂直/水平线取决于下列文件(使用Primefaces 5.0):

jqplot.canvasOverlay.js

你可以找到这个文件到位桶Cleonello Jqplot 。

: - 5添加标签和工具提示支持帆布覆盖线-到位桶Cleonello Jqplot 。



文章来源: How to add a vertical line in a horizontal bar chart using primefaces + jqplot