1

We are using PrimeFaces for making a statistics software and we have an issue with a pie chart. We want to have a value with decimal places. So we don't want percent or a rounded number, but a number with 2 decimal places. From our database we get a BigDecimal number with 4 decimal places, for example we add 2 data results to our pie model. 5.6223 and 4.1223 and we set dataFormat="value". When we hover the slices of the pie in our view we get 6 and 4.

      pitaPVC.setDataFormat("value");


      <p:chart id="pitaPVC" type="pie" 
          rendered="#{statistickoPoredjenjePoUslugamaController.fgPVC}"
          model="#{statistickoPoredjenjePoUslugamaController.pitaPVC}" />
      </b:column>

Is there a way to set the value to be with certain number of decimal places

We are using PrimeFaces 7.0

Melloware
  • 10,435
  • 2
  • 32
  • 62
Vuk
  • 11
  • 2
  • `p:chart` in PrimeFaces 7 uses jqplot and PrimeFaces has an 'externder' mechanism to customize it all like you can customize jqplot, so find a jqplot 'solution' and implement it via the extender mechanism – Kukeltje Dec 24 '19 at 10:51
  • @Kukeltje Post it as an asnwer so i can vote up, in the meantime i found the mechanism and implemented it, also did it trough Java code and trough extender javascript mechanism – Vuk Dec 24 '19 at 11:44
  • I marked it as a duplicate since that is what it is. Only one more upvote needed for this to be actually marked as such. – Kukeltje Dec 24 '19 at 11:48

0 Answers0