Hi
As mentioned by Scott,
We can do it definitely by calling DB as well as creating corresponding JCR nodes in JCR.
We can achieve it in 3 ways:-
1. Create a component/Service that exports the JDBC driver package.
//Fetch data from DB and store in JCR.
Doc:- https://docs.adobe.com/docs/en/aem/6-2/develop/platform/jdbc.html#Bundling the JDBC Database Driver
Helpx (Help to create "Querying and Persisting Adobe AEM data into MySQL" ):- https://helpx.adobe.com/experience-manager/using/querying-persisting-cq-data-mysql.html [Fetch DATA]
Helpx: - https://helpx.adobe.com/experience-manager/using/programmatically-accessing-cq-content-using.html [Accessing/Storing Content in JCR, using JCR API]
2. Obtain a data source object and create the connection in your code
Doc:- https://docs.adobe.com/docs/en/aem/6-2/develop/platform/jdbc.html#Connecting to the Database
Helpx :- https://helpx.adobe.com/experience-manager/using/datasourcepool.html
Once you retrieve the data from the database (using a injected DataSourcePool), you can encode the data into JSON.
3. Configuring the JDBC Connection Pool Service
Doc:- https://docs.adobe.com/docs/en/aem/6-2/develop/platform/jdbc.html#Configuring the JDBC Connection Pool Service
Once you have the data, you can use any JQuery Plugins to populate the data on pie charts
Link:- http://www.jqueryscript.net/tags.php?/pie%20chart/ http://designmodo.com/jquery-charts-graphs/ https://www.sitepoint.com/11-best-jquery-charting-libraries/
I hope this would be useful.
Thanks and Regards
Kautuk Sahni