Hi Arie,
If you are adding chart to the page content aggregation then it would be placed at the last element of content array.
Try something like this (Just a guess):
var oPage = sap.ui.getCore().byId("oPage"); //Get Hold of Page Control
var oContent = oPage.getContent(); //Gets the Page Conent
var oLastElement = oContent.slice(-1)[0] //Fetches the last element in content aggregation, which will be chart that is created
var oChartID = oLastElement.getId();
console.log(oChartID);Regards,
Sai Vellanki.