PDA

View Full Version : get the tooltip value of each grouped column in extjs 4 chart



skylinezpromise
25 Oct 2012, 11:39 PM
Please how is it possible?

My tooltip :

tips: {
trackMouse: true,
width: 74,
height: 28,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('Week') + ': ' + storeItem.get(EACH COLUMN OF MY GROUPED COLUMN CHART));
}
}


Please help

mitchellsimoens
29 Oct 2012, 6:31 AM
storeItem is the record so you have access to each text from the other bars in that group.

skylinezpromise
29 Oct 2012, 8:07 AM
I found on an example, they were using "item.storeField" to get the name of the field, but it's not workin for me. Any ideas please?

amitkumarchauhan
7 May 2013, 11:30 PM
I am also facing the same issue. I need to show the name of the Y-field in the tooltip,but I get only the value of it.
Here is my code:
var lineChart = Ext.create('Ext.chart.Chart', {
renderTo: Ext.get('BarChart'),
style: 'background:#fff',
insetPadding: 30,
width: 600,
height: 600,
animate: true,
store: chartData,
shadow: true,
theme: 'CustomBlue',
legend: {
position: 'right'
},
axes: [{
type: 'Numeric',
position: 'bottom',
smooth : false,
minimum: 0,
highlight: {
size: 15,
radius: 15
},
fields: ['D1','D2'],
title: 'Metric Value'
},
{
type: 'Category',
position: 'left',
fields: ['trend_key'],
title: 'Month',
minimum :0
}],
series: [ {
type: 'bar',
axis:[ 'bottom'],
xField: 'trend_key',
yField: ['D1','D2'],
tips: {
trackMouse: true,
width: 200,
height: 25,
renderer: function(storeItem, item) {
}
},
title:['L1','L2']
}]
});

So, the tooltip doesn't tell me whether D1 or D2 field has been used.