-
12 Jun 2012 11:46 PM #1
Unanswered: Problem with Grouped Chart...In extjs4
Unanswered: Problem with Grouped Chart...In extjs4
Hi Everybody....
Actually I am working with Grouped Bar-Chart in ext4 ...
in grouped chart i am displaying 3 series which of different values, What i want to do is i need to
get Click Event on each bar series and i should get value of that bar...(each BAR)....
my piece of code look like this...
// ----------- Chart Code -------------- //
{
id: 'chartCmp',
xtype: 'chart',
style: 'background:#fff',
animate: true,
shadow: true,
x: 200,
y: 250,
width: 700,
height: 500,
minHeight: 500,
minWidth: 500,
store: ChartStore,
legend: {
position: 'right bottom'
},
axes: [{
type: 'Numeric',
position: 'bottom',
fields: ['newCount','repeatedCount','deviationCount'],
minimum: 0,
label: {
},
grid: true,
title: 'Risk Catagory'
}, {
type: 'Category',
position: 'left',
fields: ['auditReportNum'],
title: 'Audit Report Number'
}],
series: [{
type: 'bar',
axis: 'bottom',
xField: 'auditReportNum',
yField: ['newCount','repeatedCount','deviationCount'],
highlight: true,
highlightCfg: {
fill: '#a2b5ca'
},
/* tips: {
trackMouse: true,
width: 140,
height: 100,
renderer: function(storeItem, item) {
this.setTitle('New '+storeItem.get('newCount'));
this.setTitle(' High :'+ Math.round(storeItem.get('highCount') / 4 * 100)
+'%'+ '</br>Low :'+Math.round(storeItem.get('lowCount')/4*100)
+'%'+'</br>Medium :'+Math.round(storeItem.get('mediumCount')/4*100)+'%'
+'</br> Recommended :'+Math.round(storeItem.get('recommendedCount')/4*100)+'%');
}
},*/
listeners: {
trackMouse: true,
'itemmouseup': function(storeItem, item) {
alert(item.get('newCount'));
//barChartStore.loadData(record.get('depBreakdown'));
/* var rec = ChartStore.getAt(o.index);
alert(" REcord "+rec+o.index);
alert(rec.get('newCount'));*/
// Ext.example.msg('Testing', 'You selected {0}.', rec.get('newCount'));
}
}
}]
// --------------- End : Chart Code ------------------ //
//------Store ------------ //
/** User Defined Store for Chart */
var ChartStore = Ext.create('Ext.data.SimpleStore',{
fields: ['auditReportNum', 'newCount','repeatedCount','deviationCount','newNameP']
});Code:
I hope i will get a soulution from Sencha....
Thank You.
-
13 Jun 2012 1:07 AM #2
hi
if you want to just show the value , open the tips tag . the below will code work.
and use console.log() instead of alert to show valls
Code:tips: { trackMouse: true, width: 140, height: 100, renderer: function(storeItem, item) { this.setTitle('New '+storeItem.get('newCount')); } }
-
13 Jun 2012 1:14 AM #3
or you can use like this ,
that will be better
tips: {
trackMouse: true,
width: 140,
height: 100,
renderer: function(storeItem, item) {
var myVal=item.value;
myVal=Ext.util.Format.number(myVal, '0,0')
this.setTitle(myVal);
}
}
-
13 Jun 2012 2:09 AM #4
is it possible to put this in listener....?
listeners: {
trackMouse: true,
'itemmouseup': function(storeItem, item) {
var myVal=item.value;
alert(myVal);
myVal=Ext.util.Format.number(myVal, '0,0')
alert(myVal);
}
}
but in alert i am getting blank.......
ok i will try now....Last edited by kantha.exe; 13 Jun 2012 at 2:17 AM. Reason: added code
-
13 Jun 2012 8:20 AM #5
in tips it work properly but in listener i am not sure ...
-
13 Jun 2012 8:46 PM #6
Grouped Chart
Grouped Chart
Is there any other way for this....?
-
14 Jun 2012 6:03 AM #7
did you try it in tips with second answer?
-
14 Jun 2012 11:55 PM #8
Grouped Chart
Grouped Chart
I tried not working....



Reply With Quote