Apr 03, 2013, 9:26 PM
[CLOSED] Adding line series tooltip dynamically.
Hi,
I would like to assign the tooltip property of the line series after the line series is rendered. I know I can configure the tip property of the series and it will work. but this is causing some javascript error when there is a mouse over the chart while it is rendering. So we want to be able to setup the tooltip after the chart have been added to the panel.
below is our code sample.
I would like to assign the tooltip property of the line series after the line series is rendered. I know I can configure the tip property of the series and it will work. but this is causing some javascript error when there is a mouse over the chart while it is rendering. So we want to be able to setup the tooltip after the chart have been added to the panel.
below is our code sample.
var store = Ext.create('Ext.data.JsonStore', {
fields: result.result.Fields,
data: result.result.Data
});
var numAxes = {
type: 'Numeric',
position: 'left',
fields: result.result.Yfields,
title: result.result.YfieldLabel,
minimum: 0,
labelTitle: {
"font": "bold 11px Tahoma"
}
};
var chart = {
width: 800,
height: 600,
animate: true,
store: store,
xtype: "chart",
axes: [numAxes,
{
type: 'Category',
position: 'bottom',
fields: [result.result.Xfield],
title: result.result.XfieldLabel,
grid: true,
length: 100,
width: 100
}],
// Add the line Series
series: [
{
type: 'line',
highlight: {
size: 7,
radius: 7
},
axis: 'left',
xField: 'Name',
yField: 'Value',
listeners: {
itemClick: function (item) {
if (item.storeItem.raw.IsInitializingData || !(item.storeItem.data[item.series.yField])) {
return;
}
item.storeItem.raw.ResultSetId = portlet.panelDefinition.SettingInfo.CurrentResultSetId;
item.storeItem.raw.ResolutionType = "Open";
NewWorkItemsLineChart.DataPointClicked(item, panelDefinition.MaximizeUrl, panelDefinition.Name, panelDefinition.Description);
}
},
markerConfig: {
type: 'cross',
size: 4,
radius: 4,
'stroke-width': 0
}
}
]
}
chart = panel.add(chart);
----------->>>>>>>> below is my concern this is not working for assigning the tip
chart.series.items[0].tips = {
trackMouse: true,
width: 240,
height: 28,
anchorToTarget: false,
anchor: "top",
renderer: function (storeItem, item) {
//custom rendering ignore.
}
};
Last edited by Daniil; Apr 09, 2013 at 4:13 AM.
Reason: [CLOSED]