0

I am trying to set a visualforce gauge chart to have the maximum value be a currency field from the user record.

I can get the field:

    Decimal userAmount = [Select ISO_Goal__c From User Where Id = :UserInfo.getUserId()]
[0].ISO_Goal__c.intValue();
Integer uA = userAmount.intValue();

I've set the value for myself to be 100.00. I can do a anonymous apex is shows up as a whole number 100. When I view my visualforce page I get the error that it cannot convert it to a integer.

<apex:page controller="ISOGaugeController2b"> 
<apex:chart height="175" width="250" animate="true" data="{!piedata}">
<apex:axis type="Gauge" position="gauge" title="Dan Test"
    minimum="0" maximum="uA" steps="0"/>
<apex:gaugeSeries dataField="data" donut="50"/>
</apex:chart>
</apex:page>

Is there something I am doing wrong?

  • I would expect uA to be a controller property and to see maximum="{!uA}" in the page. – Keith C Apr 28 '16 at 16:18
  • Doesn't work, it says "unknown property 'ISOGaugeController2b.uA'". – Dan Wooding Apr 28 '16 at 17:35
  • Yes, "uA to be a controller property" means having a controller field public Integer uA {get; set;} and setting the amount in that field. – Keith C Apr 28 '16 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.