PDA

View Full Version : Pie(Donut) metric not poping out if shadow : false



ajithct
16 Oct 2013, 11:40 PM
Am facing a problem with donuts chart. When I provide shadow : false, the green metric(metric 1) is not popping out, but if I provide the shadow : true all the metrics are popping out.

Expected Result : All metrics must pop out even though shadow is false

Additional Information : Am using Extjs V 4.1 and I need animation on pop out..


var store = Ext.create('Ext.data.JsonStore', { fields: ['name', 'data'],
data: [
{ 'name': 'metric one', 'data': 10 },
{ 'name': 'metric two', 'data': 7 },
{ 'name': 'metric three', 'data': 5 },
{ 'name': 'metric four', 'data': 2 },
{ 'name': 'metric five', 'data': 27 }
]
});


Ext.create('Ext.chart.Chart', {
renderTo: Ext.getBody(),
width:500,
height: 350,
animate: true,
store: store,
shadow:false, //If true all metrics are popping out

theme: 'Base:gradients',
legend: {
position: 'right',
boxFill: '#000',
labelColor: '#fff'
},
series: [{
type: 'pie',
angleField: 'data',
donut:45,
showInLegend: true,
tips: {
trackMouse: true,
width: 140,
height: 28,
renderer: function(storeItem, item) {
// calculate and display percentage on hover
var total = 0;
store.each(function(rec) {
total += rec.get('data');
});
this.setTitle(storeItem.get('name') + ': ' + Math.round(storeItem.get('data') / total * 100) + '%');
}
},
highlight: {
segment: {
margin: 20
}
},
label: {
field: 'name',
display: 'rotate',
contrast: true,
font: '18px Arial'
}
}]
});

Gary Schlosberg
21 Oct 2013, 11:20 AM
I put your code into a Fiddle:
https://fiddle.sencha.com/#fiddle/13b

I can see the issue, but it looks like it was fixed in 4.2.0. I'm going to guess this issue:
http://www.sencha.com/forum/showthread.php?239722

If you are unable to upgrade and need to override, check the changes in src/chart/series/Series.js between 4.1.1 and 4.2.0.

ajithct
27 Oct 2013, 10:07 PM
Ya Gary, this works fine with the 4.2 v, since am using 4.1 will try with the overriding process..

Thanks for the response..