When we create a primefaces
chart then it shows number scale in decimal points. I want to show without decimal places like simple munbers.Is there a way?
Thanks
相关问题
- java.lang.NullPointerException at java.io.PrintWri
- java.lang.NullPointerException at java.io.PrintWri
- h:selectOneMenu in p:dataTable doesn't submit
- h:selectOneMenu in p:dataTable doesn't submit
- PrimeFaces block UI does not work when the compone
相关文章
- Mercurial Commit Charts / Graphs [closed]
- Change color of bars depending on value in Highcha
- How to allow numbers only using f:validateRegex
- JSF 2.0: ajax request when press ENTER
- Google Chart veritcal axis with percentage sign
- Google Combo Chart add horizontal and vertical lin
- Formatting a double in JSF
- ChartJS. Change axis line color
Update:
While the workaround posted below still works I found a more proper solution to do this. Number scale can be formatted trough
extender
function:place the following function between the
<head></head>
tags on your page:After experimenting a bit with jqPlot I found out that if you reset the axes after the plotting has finished the decimals after the decimal point are cleared. If your barChart is definied like this:
call the following function after the page load is finished:
Note that instead of resetting both axes with
resetAxesScale
you can reset x or y separately by doing:window.barChartObj.plot.axes.xaxis.resetScale();
or
window.barChartObj.plot.axes.yaxis.resetScale();
You can also expriment with decreasing the timeout to smaller numbers to achieve smoother replot. For other options see the jqPlot documentation.
Tested in Google Chrome 22.0.1229.94 (Official Build 161065).