I am attempting to provide selective formatting of the tool tip when over a particular bar/column of a grouped series based on the field that is tied to the particular bar/column in the group.
In the code below, the grouped fields are in green.
Code:
{
"xtype" : "chart",
animate: true,
shadow: true,
"store" : "dbCustomerCurrentRevenue",
"theme" : "Base:gradients",
"legend" :
{
"labelFont" : "9px helvetica",
"position" : "top"
},
axes: [{
type: 'Numeric',
position: 'left',
fields: ['customer_revenue_total', 'customer_shipments', 'customer_total_mileage'],
minimum: 0,
grid: true,
title: 'Revenue ($1k), Mileage (1k mi), Shipments'
}, {
type: 'Category',
position: 'bottom',
fields: ['customer_name'],
title: 'Customers',
label: {
renderer: function(v) {
return Ext.String.ellipsis(v, 15, false);
},
font: '9px Arial',
rotate: {
degrees: 270
}
}
}]
,
series: [{
type: 'column',
axis: 'left',
highlight: true,
groupGutter: 10,
title: ['Revenue','Mileage','Shipments'],
tips: {
trackMouse: true,
width: 140,
height: 28,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('customer_name') + ': ' + storeItem.get('customer_total_mileage') + ' mi.');
}
},
label: {
display: 'insideEnd',
'text-anchor': 'middle',
field: ['customer_revenue_total','customer_total_mileage','customer_shipments'],
orientation: 'vertical',
"contrast" : true
},
xField: 'customer_name',
yField: ['customer_revenue_total','customer_total_mileage','customer_shipments']
}]
}
I tried to use the following code , which I expected to give me the field name of the field bound to the column along with its value (which works in the AreaBrowserStats example just fine (!?!),
Code:
renderer: function(storeItem, item) {
this.setTitle(item.storeField + ' - '
+ storeItem.get(item.storeField) + '%');
}
...BUT, the string returned (displayed in the toolTip) is "undefined - undefined%'. ??
Note: The following code:
Code:
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('customer_name')
+ ': ' +storeItem.get('customer_total_mileage') + ' mi.');
}
Works fine and displays the customer_name value and customer_total_mileage value for the current store record just fine obviously is presenting the hardcoded customer_total_mileage for each column. My desire is that I can appropriately format/display the value for each field (revenue, mileage, shipments) based on which column I am hovering over.
Any ideas? What am I missing?
Thx in advance.