PDA

View Full Version : How to remove animation in pie chart



mrprabu
12 Feb 2014, 10:20 PM
I used animate:false, even when ever mouse over particular data in chart , chart getting movement. how to restrict mouseover movement

47910

palakurthivishal
12 Feb 2014, 11:26 PM
Hello mrprabu,
Please checkout "highlight" property of pie-series. Make it false if you don't want the pie to spread out on hover.

mrprabu
13 Feb 2014, 12:36 AM
still behaves the same

mdnaveed42
13 Feb 2014, 12:58 AM
Hi,

highlight: false works, below is the sample code,


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: false,
store: store,
theme: 'Base:gradients',
series: [{
type: 'pie',
angleField: 'data',
donut: 60,
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: false,
label: {
field: 'name',
display: 'rotate',
contrast: true,
font: '18px Arial'
}
}]
});



Thanks,
Md Naveed
\m/