Pie chart widget erroring - Mendix Forum

Pie chart widget erroring

0

I am trying to use the Mendix created Chart widget and get the following error when I try to setup a pie chart

Converting circular structure to JSON
    --> starting at object with constructor 'HTMLDivElement'
    |     property '__reactInternalInstance$9uot1rzhb96' -> object with constructor 'Kn'
    --- property 'stateNode' closes the circle TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'HTMLDivElement'
    |     property '__reactInternalInstance$9uot1rzhb96' -> object with constructor 'Kn'
    --- property 'stateNode' closes the circle
    at JSON.stringify (<anonymous>)
    at http://localhost:8080/mxclientsystem/mxui/mxui.js?637001824125804575:51:221644
    at Array.map (<anonymous>)
    at e.log (http://localhost:8080/mxclientsystem/mxui/mxui.js?637001824125804575:51:221554)
    at http://localhost:8080/mxclientsystem/mxui/mxui.js?637001824125804575:51:252782
    at http://localhost:8080/mxclientsystem/mxui/mxui.js?637001824125804575:51:223120
    at Array.forEach (<anonymous>)
    at e.log (http://localhost:8080/mxclientsystem/mxui/mxui.js?637001824125804575:51:223091)
    at e.debug (http://localhost:8080/mxclientsystem/mxui/mxui.js?637001824125804575:51:222432)
    at e.renderChart (http://localhost:8080/widgets/com/mendix/widget/custom/PieChart/PieChart.js?637001824125804575:12:98100)

A quick google and there is nothing obvious about this error, I am guessing it may be a conflict with another library but still, unsure.

I have setup the required properties: entity, name, value, color.

 

asked
1 answers
0

Hi Harry conibre i think its json.stringify error , you can try like this 

 

// Demo: Circular reference
var o = {};
o.o = o;

// Note: cache should not be re-used by repeated calls to JSON.stringify.
var cache = [];
JSON.stringify(o, function(key, value) {
    if (typeof value === 'object' && value !== null) {
        if (cache.indexOf(value) !== -1) {
            // Duplicate reference found, discard key
            return;
        }
        // Store value in our collection
        cache.push(value);
    }
    return value;
});
cache = null;
answered