Rog*_*ury 1 charts jsf primefaces
我正在使用Primefaces整理一个非常基本的堆积条形图.图表本身似乎很好.但是,图例被放置在图表数据上.我知道你可以将图例移动到任何罗盘序号(n,s,w,e,se,sw,ne,nw),但我实际上想把它移出数据.
获取它的代码:
<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" />
Run Code Online (Sandbox Code Playgroud)
它目前看起来像什么.想把这个传奇从图表中移到右边.
现在最好的解决方案是在图表模型上定义placemant:
...
modelChart.setLegendPlacement(LegendPlacement.OUTSIDE);
...
Run Code Online (Sandbox Code Playgroud)
尝试添加:
function extLegend()
{
this.cfg.legend= {
show: true,
location: 's',
placement: 'outsideGrid'
};
}
Run Code Online (Sandbox Code Playgroud)
并在barChart
组件中添加:
extender="extLegend"
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
14642 次 |
最近记录: |