0

I am trying to draw a bar chart using PrimeFaces. I can draw the chart properly but problem is variables in the x-axis could be too long.I want display next line if more than one word.How can I achieve this .Please help me out.

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
BOBBY
  • 61
  • 4
  • 11
  • I added a relevant tag and improved your title. PF chart has the extender functionality. Try to search on jqplot on how to wrap long labels and use that via the extender – Kukeltje Jan 07 '16 at 19:54
  • So it works fine for line charts? – Kukeltje Jan 07 '16 at 19:55
  • I have tried extender extender function still I am not getting wrap long label.Please post example code if you have sample. Thanks in advanced. – BOBBY Jan 08 '16 at 07:09
  • But what did you try? And no, sorry, I don't have any example – Kukeltje Jan 08 '16 at 07:44
  • I am tried bellow code ,still not achieve wrap text labels . function my_ext() { this.cfg.axes.xaxis = { min:0, max:100, tickInterval:10 , tickOptions:{ formatString : '%02d' } }; } – BOBBY Jan 08 '16 at 13:55
  • but what **does** happen if you use this... – Kukeltje Jan 08 '16 at 15:04
  • To emphasizeThis is *all* jqplot related...Nothing PF can do about it – Kukeltje Jan 08 '16 at 15:23
  • http://stackoverflow.com/questions/9263551/jqplot-custom-tick-labels (or rotate the labels) – Kukeltje Jan 08 '16 at 15:47
  • I have tried following code still I am not wrap the data. //#include function my_ext() { this.cfg.axes = { yaxis: { numberTicks: 10, labelRenderer: $.jqplot.CanvasAxisLabelRenderer, labelOptions: { fontFamily: 'Verdana', fontSize: '8pt' }, }, xaxis: { renderer:$.jqplot.CategoryAxisRenderer, rendererOptions: { tickRenderer:$.jqplot.CanvasAxisTickRenderer }, labelRenderer: $.jqplot.CanvasAxisLabelRenderer, labelOptions: { fontFamily: 'Verdana', fontSize: '8pt' } } }; } // – BOBBY Jan 13 '16 at 10:31
  • why did you expect this to wrap the labels? – Kukeltje Jan 13 '16 at 10:51
  • In my bar chart labels are too long its looking not good so user wants to wrap the label for every word. – BOBBY Jan 18 '16 at 06:58
  • Yes that is the basic problem, but based on what part of your last posted code did you expect it to work – Kukeltje Jan 18 '16 at 08:16
  • I am new to Jqflot related things .I just google it and found some label warping code and tried through extension java-script function of prime faces chart.If you think any thing on this please let me know I will do that or any other solution. – BOBBY Jan 18 '16 at 08:49

0 Answers0