I am using primefaces 5.1 and I am unable to display the percentages of the p:chart component as decimals. In the previous versions of primefaces this component was p:pieChart, and with that to display decimal one had to use the extender attributes of the pieChart. In the version 5.1 the p:chart component doesn't have this attribute.
Asked
Active
Viewed 1,645 times
0
-
1So your BASIC question is NOT about decimal places, but about problems with the extender. Start here: http://stackoverflow.com/questions/30644676/how-to-use-line-chart-extender-attribute-in-primefaces-5-2 (and also read the docs and look at the showcase) – Kukeltje Feb 16 '16 at 14:52
-
So the duplicate has the right info? Great, next time please try to think what the core problem is that you have if you are sure you are thinking in the right direction (like in this case you did... extender...) Makes finding relevant questions easier (suggestions by stackoverflow e.g.) – Kukeltje Feb 16 '16 at 15:13
1 Answers
0
I finally added the javascript function below to my viewer.
function ext() {
this.cfg.seriesDefaults.rendererOptions.dataLabelFormatString = '%.4s%%';
this.cfg.seriesDefaults.rendererOptions.dataLabelThreshold = 0;
}
In the backend (controller) I parsed the string setExtender of the model to the name of my javascript function.
myPieChartModel.setExtender("ext");

cdaiga
- 4,861
- 3
- 22
- 42