Oct 14, 2014, 8:10 AM
Passing Pie Chart Id to Tip Render Function
I need to have more than one Pie Chart in the same web page. How can I pass the Chart Id to the tip render function?
In this example, the Chart1 is hardcode.
https://examples2.ext.net/#/Chart/Pie/Basic/
In this example, the Chart1 is hardcode.
https://examples2.ext.net/#/Chart/Pie/Basic/
var tipRenderer = function (storeItem, item) {
//calculate percentage.
var total = 0;
App.Chart1.getStore().each(function (rec) {
total += rec.get('Data1');
});
this.setTitle(storeItem.get('Name') + ': ' + Math.round(storeItem.get('Data1') / total * 100) + '%');
};