+ Start a Discussion

visualforce charting

Hi all,

How many objects can we include in visualforce charting ?
say for example I have one field in account object and another field in opportunity object ,those two objects we dont have any relation
but is it possible to take the values  and do the chart by using (pie chart)(<apex:chart>)  ?

Please let me know


Yes it is possible. For your case you can create a wrapper class and store the data from Account and Opportunity objects in wrapper list.
You can pass this list to <apex:chart data="{!myWrapperList}"> and it should work.

If you are unaware of wrapper classes; just google it and you will find quite a lot of code snippets which you can refer.
Also refer "Visualforce page developers guide" for examples on charting.

Hope this will help you to get your answer!!!
Thanks for your Reply kulkarni ,I got it