Here is a more complete example with the various options on how to redirect the user based on clicking a slice.
Example: http://codepen.io/knagis/pen/aBGqyy
var data = {
"subvalues": [{
id: "s1",
value: 50,
name: "styleFunction"
}, {
id: "s2",
value: 30,
name: "data.style",
style: {
url: "javascript:alert('s2');"
}
}, {
id: "s3",
value: 20,
name: "onClick"
}]
};
var t = new PieChart({
container: document.getElementById("demo"),
area: {
height: 350
},
data: {
preloaded: data
},
slice: {
styleFunction: function(s) {
if (s.id === "s1") {
s.url = "javascript:alert('s1');";
s.urlTarget = "_self";
}
}
},
events: {
onClick: function(e, args) {
if (args.clickSlice && args.clickSlice.id === "s3") {
e.preventDefault();
document.location = "javascript:alert('s3')";
// or use window.open()
}
}
}
});