alpsilva Report post Posted July 23, 2020 i'm trying to process data from a query. So I create a JSON object and populate it using a loop, like so: var processedData = [{ label: "teste", value: 123 }, { label: "teste2", value: 321 }]; if (dataParse.response) { dataParse = dataParse.response; for (var aux of dataParse) { jsonAux = { label: aux.departamento, value: parseInt(aux.quantidade) } processedData.push(jsonAux); } } after the loop, the object is returned and used as chart data. As seen in the image attached, it is done without problems (For testing purposes, i initialized the object "processedData" with two test elements: "teste1" and "teste2"). But FusionChart can only load the initiliazed elements. I don't have any idea why this is happening and already tried many different ways to do this. Would be really glad if someone could be of use. Thanks in advance. Share this post Link to post Share on other sites
Akash Biswas Report post Posted July 23, 2020 Hi, It seems that the chart is rendering using the initial values set to the "processedData" variable, but the "processedData" variable is getting updated with the fetched values after the chart is rendered(with initial data). As it is taking a while to execute the query to fetch the data, by then it is rendering the chart with the initial data. Please ensure that you are rendering the chart after the data is fetched and the "processedData" variable is updated. You could check that by setting a delay accordingly to render the chart so that the variable is updated with the fetched data. Check these samples for reference : Fiddle similar to your scenario : http://jsfiddle.net/va8nyfzx/3/ Fiddle setting a delay to render the chart : http://jsfiddle.net/va8nyfzx/4/ Thanks, Akash. Share this post Link to post Share on other sites
alpsilva Report post Posted July 24, 2020 It worked. I'm really grateful! Share this post Link to post Share on other sites
Akash Biswas Report post Posted July 24, 2020 Many thanks for the acknowledgement! Share this post Link to post Share on other sites