ahsec
10 Oct 2012, 7:02 AM
Hello
I would like my pie's legend to contain a name of a field
and the matching cut on the pie to carry the percentile of that pie...
how can I separate the values?
I tried
width: 500, height: 350,
animate: true,
store: pie_store,
id:'pie_chart',
theme:'Browser',
series: [{
type: 'pie',
field: 'data',
tips: {
trackMouse: true,
width: 170,
height: 35,
renderer: function(storeItem, item) {
// calculate and display percentage on hover
var total = 0;
pie_store.each(function(rec) {
total += rec.get('data');
});
this.setTitle(storeItem.get('name') + ': ' + storeItem.get('data') );
}
},
highlight: {
segment: {
margin: 20
}
},
showInLegend: true,
label: {
field: 'percentage',
display: 'rotate',
contrast: true,
font: '15px Arial',
}
}],
legend:{
position:"right"
}
but now the legend and the cut both carry the "percentage" ...
any Idea anyone?
Thanks
I would like my pie's legend to contain a name of a field
and the matching cut on the pie to carry the percentile of that pie...
how can I separate the values?
I tried
width: 500, height: 350,
animate: true,
store: pie_store,
id:'pie_chart',
theme:'Browser',
series: [{
type: 'pie',
field: 'data',
tips: {
trackMouse: true,
width: 170,
height: 35,
renderer: function(storeItem, item) {
// calculate and display percentage on hover
var total = 0;
pie_store.each(function(rec) {
total += rec.get('data');
});
this.setTitle(storeItem.get('name') + ': ' + storeItem.get('data') );
}
},
highlight: {
segment: {
margin: 20
}
},
showInLegend: true,
label: {
field: 'percentage',
display: 'rotate',
contrast: true,
font: '15px Arial',
}
}],
legend:{
position:"right"
}
but now the legend and the cut both carry the "percentage" ...
any Idea anyone?
Thanks