I am following the only example that I found about data function on PieCharts:
https://zoomcharts.com/developers/en/pie-chart/examples/data-sources/data-function.html
And trying to adjust to my situation that is a angular service call:
function myDataFunction(pieId, limit, offset, successCallback, errorCallback) {
var filter = {
ID: 10,
idSection: $scope.main.idSection
};
MyService.getSomething(filter).success(function (data) {
myDataPie = JSON.parse(data.value);
console.log(JSON.parse(data.value));
successCallback(pieId, limit, offset);
});
}
var indicador = new PieChart({
container: document.getElementById("myChart"),
area: { height: 350 },
data: { dataFunction: myDataFunction },
...
Although the data object is just as I expect, the pie is not filled with the info.
I am not sure about how I should call the callback function.
Could you help me?