Closed OElesin closed 7 years ago
I want to add KPIs to the dashboard dynamically. See my code below:
var avgSpendKPI = new KPIGroupComponent (); for (var key in segmentProfiles) { var caption = key.capitalize() + " Customers" var id = key.replace(" ", "_") var options = { caption: caption, value: segmentProfiles[key].avg_amount, numberHumanize: true, numberPrefix: "NGN " } avgSpendKPI.addKPI(id, options); }
This only displays one KPI but when I click to show modal, it displays all KPIs as a table. Can you advice on what to do?
Thanks in advance
Solved the issue. Turns out the KPI ids had space in them. Hence, I now create id like this:
id
var id = key.replace(/ /g, '_');
Ensure no spaces in KPI ids
I want to add KPIs to the dashboard dynamically. See my code below:
This only displays one KPI but when I click to show modal, it displays all KPIs as a table. Can you advice on what to do?
Thanks in advance