I have p:barchart graph in my application similar to the second barchart on the showCase: http://www.primefaces.org/showcase/ui/barChart.jsf
<p:barChart id="horizontal" value="#{chartBean.categoryModel}" legendPosition="se" style="height:300px"
title="Horizontal Bar Chart" orientation="horizontal" min="0" max="200"/>
how can I customize the Numbers on my X-axis. I want to format the x-axis to use only Integers.
thanks in advance.
your extender function could be like this
I had the same problem and this works great, I based on Daniel's Answer and some other code. This way it just format the desired axis, not both.
Try this (not tested):
In you js add this
or this x axis only :
You can try playing with
tickInterval
...Straight from the PrimeFaces Userguide
Extender
Charts provide high level access to commonly used jqplot options however there are many more customization options available in jqplot. Extender feature provide access to low level apis to do advanced customization by enhancing this.cfg object, here is an example to increase shadow depth of the line series;
Refer to jqPlot docs for the documentation of available options; http://www.jqplot.com/docs/files/jqPlotOptions-txt.html Converter
In you js add this
You can set format to axis from your @ManagedBean class using the following code: