+ Start a Discussion
robertcw777robertcw777 

Upper and Lower Bounds on Visualforce Gauge

I'm using VF charting to display a gauge on a page. I can't see anyway to set different colors for upper and lower bounds on the gauge face. For example, I want to have the gauge show a range or -100 to +100, and have the gauge face show up as green between +/- 20, Yellow between 20 and 40 and -20 and -40,  and red outside those limits. I know you can set color sections like this on the saleforce dashboard gauage, but can't see any way to do in VF. I can set two colors in the apex:gaugeSeries so that it shows one color left of the needle and another above the needle, but I need to have a static display with different colors on the gauge face itself. Appreciate if someone knows if this can or can't be done.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Sonam_SFDCSonam_SFDC

Hi Robert,

 

I did some research and looks like the new addition of colorset attribute to Gauge chart for Visualforce supports min and max values and two color representing the range as of now.

(http://developer.force.com/releases/release/Winter13/Visualforce+Charting+GA)

 

I did find a workaround which was suggested by a user who wanted something similar:

http://salesforce.stackexchange.com/questions/15916/visualforce-gauge-with-breakpoints

 

Would sugegst you to go thorugh and see if that can fit your requirement..

All Answers

Sonam_SFDCSonam_SFDC

Hi Robert,

 

I did some research and looks like the new addition of colorset attribute to Gauge chart for Visualforce supports min and max values and two color representing the range as of now.

(http://developer.force.com/releases/release/Winter13/Visualforce+Charting+GA)

 

I did find a workaround which was suggested by a user who wanted something similar:

http://salesforce.stackexchange.com/questions/15916/visualforce-gauge-with-breakpoints

 

Would sugegst you to go thorugh and see if that can fit your requirement..

This was selected as the best answer
robertcw777robertcw777

Thanks, Sonam. At least I won't waste any more time trying to get the limits on the gauge face. I am going to just get the face color from the controller and change the color of the entire gauge to red, yellow or green depending on the value.

 

Hope this is something that gets added in a future release.

 

Bob

Kris Hollen 14Kris Hollen 14
I know this is an old post but do you know how to call the assigned color parameters from the controller? I keep getting an error.