主题:图表和图例位置 [英] Primefaces: Charts and Legend position

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

问题描述

我正在使用Primefaces组合一个非常基本的堆叠条形图。图表本身似乎构建恰到好处。但是,图例放在图表数据上。我知道你可以移动传说到任何罗盘序数(n,s,w,e,se,sw,ne,nw),但我实际上想把它关闭数据。

I'm working on putting together a pretty basic stacked bar chart using Primefaces. The chart itself seems to build just fine. However, the legend is being placed over the chart data. I know you can move the legend to any compass ordinal (n, s, w, e, se, sw, ne, nw), but I'd actually like to move it OFF the data.

获取代码:

 <p:barChart id="stackedKWH" value="#{kwhSalesBeanManager.kwhSalesChart}" legendPosition="e" style="height:300px;width:800px" title="kWh Sales by Type" stacked="true" barMargin="10" min="0" max="125000000" />

目前的样子。希望将图例从右侧移到右侧。

And what it currently looks like. Would like to move that legend off the chart to the right.

推荐答案

尝试添加:

function extLegend() 
{
    this.cfg.legend= {
        show: true,
        location: 's',
        placement: 'outsideGrid'
    };
}

并将其添加到 barChart 组件:

 extender="extLegend"

这篇关于主题:图表和图例位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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