How to generate Column Chart in Visualforce pages and I have a requirement that on click of color column of chart , i have to perform some task. How can i perform that also ?
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
- Create a Google Column Chart.
- From your page, get the data from a Salesforce. Here are some possibilities.
- Create an Apex controller and call to it from your page. Look at using a @RemoteAction to get the data. You may want to use the Analytics API in Apex to get the data.
- Use Remote Objects and don’t use an Apex Controller at all.
- Configure your chart to handle the event. See Handling Events and Column Chart Events.
Here is a simple example from the Google Column Chart docs. You would need to replace the static sample data with data retrieved dynamically and also add in the event handling.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0