【问题标题】:Is it possible to rotate Pie Chart of Primefaces?是否可以旋转 Primefaces 的饼图?
【发布时间】:2013-12-03 07:30:52
【问题描述】:

Primefaces的饼图可以旋转吗?

使用 primefaces 生成的普通饼图如下所示:

Original Pie

如果我想旋转饼图并让起始角度像这样从饼图顶部开始呢?

Intended Pie

抱歉,我无法插入图片...

提前致谢。

【问题讨论】:

    标签: jsf primefaces pie-chart


    【解决方案1】:

    是的。

    将属性extender="ext1" 添加到您的<p:pieChart/> 并在您的脚本文件中添加以下内容:

    function ext1() {
        this.cfg.seriesDefaults = {
            renderer : $.jqplot.PieRenderer,
            rendererOptions : {
                // rotate the starting position of the pie around to 12 o'clock.
                startAngle : -90
            }
        };
    };
    

    Primefaces 图表是用 jqPlot 生成的。有关它的功能和定制的更多信息,请查看网站http://www.jqplot.com/index.php

    【讨论】:

    • 你能告诉我什么是cfg吗?我查看了 jqplot 网站,但仍然不知道“cfg”代表什么。
    • cfg代表配置。
    • 感谢您的解释
    猜你喜欢
    • 2019-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多