Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
680
pie chart legend label not binding correctly
posted

Hi all,

I have a pie chart and am using ajax to return the data as a json object.  This all works fine and the pie chart displays correctly and the tooltips display correctly showing the label, however the legend text does not appear to bind to the labelMemberPath and simply displays the text within the option 'labelMemberPath' text e.g. 'ProductGroup'.

Any ideas on how to fix this?

 

                $(this).igPieChart({
                        height: "300px",
                        width: "300px",
                        valueMemberPath: 'Sales',
                        labelMemberPath: 'ProductGroup',
                        legend: {
                            element: legend,
                            type: "item"
                        },
                        explodedSlices: '0 1',
                        radiusFactor: .8,
                        labelsPosition : 'none',
                        showTooltip: true,
                        tooltipTemplate: "<div class='tooltip'>${item.ProductGroup}</div><div>Sales: ${item.Sales}</div>",
                    })

                    $.getJSON(server_url + 'data/GetKPIData/' + $(this).data('guid'),
                    function (data) {
                        var elemId = "[data-guid='" + data.Guid + "']";
                        $(elemId).igPieChart("option", "dataSource", data.Data);
                    });