Reputation: 141
I want to set width of bars in barchart of primefaces.I tried this extender but didn't work :
this.cfg.seriesDefaults = {
rendererOptions: {
barWidth:10
}
};
How can i handle this?
Thanks.
Upvotes: 1
Views: 2205
Reputation: 1
In case your are still looking for a solution, I would suggest trying the following:
this.cfg.seriesDefaults.rendererOptions= {
barWidth:10
};
I slightly modified the syntax of your code. It worked fine with me.
Hope it helps.
Upvotes: 0
Reputation: 2439
You should set width of barchart dynamically by setting style attribute like below, component arrange bar width automatically;
style="height:720px; width:#{statisticBean.barChartWidth}px"
Set your barChart with on bean side by calculating barcount*barwidth+66 for example; Use 10 for barwidth. Multiply with chartItemCount and add 66 or something for bar label width.
public int getBarChartWidth() {
return chartItemCount * 10 + 66;
}
Good Luck!
Upvotes: 1