PDA

View Full Version : Add renderer in Chart Pie legend



fabio.policeno
16 Feb 2012, 7:05 AM
Hello,

How to add renderer in legend of chart pie?

Thank's

mitchellsimoens
16 Feb 2012, 8:53 AM
The legend doesn't support a renderer.

fabio.policeno
16 Feb 2012, 9:03 AM
=/
So there is no logic in applying renderer series, ends up being useless to use. Any predictions?

Thank you!

fabio.policeno
16 Feb 2012, 9:06 AM
http://www.brimg.info/uploads/5/a58d98ff38.png (http://www.brimg.info)31778

fabio.policeno
26 Oct 2012, 2:43 AM
Ext.override(Ext.chart.series.Pie, {
rendererLegend: undefined,

initialize : function() {
var me = this,
store = me.chart.getChartStore(),
data = store.data.items,
i, ln, rec, value;

//Add yFields to be used in Legend.js
me.yField = [];
if (me.label.field) {
for (i = 0, ln = data.length; i < ln; i++) {
rec = data[i];
value = Ext.isFunction(me.rendererLegend) ? me.rendererLegend(rec.get(me.label.field)) : rec.get(me.label.field);
me.yField.push(value);
}
}
}
});

Sample:

...
series : [{
type : 'pie',
field : 'value',
showInLegend : true,
rendererLegend: Ext.util.Format.dateRenderer('Y-m-d H:i:s'),
...