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
5
Unable to disable labels and maintain legend
posted

Hello

I am unable to disable the labels without disabling the legend's values.

var data1 = [
{ "SqFt": 102000, "ShortLabel": "BC", "Label": "British Columbia" },
{ "SqFt": 102000, "Label": "Manitoba", "ShortLabel": "MB" },
{ "SqFt": 102000, "Label": "Ontario", "ShortLabel": "ON" },
{ "SqFt": 102000, "Label": "Alberta", "ShortLabel": "AB" },
{ "SqFt": 102000, "Label": "Sasatchewan", "ShortLabel": "SK" },
{ "SqFt": 102000, "Label": "Quebec", "ShortLabel": "QC" },
{ "SqFt": 102000, "Label": "New Brunswick", "ShortLabel": "NB" },
{ "SqFt": 102000, "Label": "Nova Scotia", "ShortLabel": "NS" },
{ "SqFt": 102000, "Label": "Yukon", "ShortLabel": "YUK" }];

$("#chart").igDoughnutChart({
width: "100%",
height: "300px",
innerExtent: 40,
series:[
{
name: "SqFt",
outlines: ["white"],
labelMemberPath: "ShortLabel",
//labelsPosition: "none",
formatLabel: function (context) {
return "context.itemLabel";
},
legend: { element: "selectorForLegendElement" },
valueMemberPath: "SqFt",
dataSource: data1,
showTooltip: true,
brushes: ["#005fb3", "#5578c2", "#5793f3", "#dd4d79", "#bd3b47", "#dd4444", "#fd9c35", "#fec42c", "#d4df5a"],
tooltipTemplate: "<div class='ui-chart-tooltip'><div class='bold'>${item.Label}</div><div><label class='bold'>${item.SqFt} sq. ft.</label></div></div>"
}
]
});

As soon as I set "labelsPostion" to 'none' the legend only returns the value of labelMemberPath variable.