1
votes

I have a chart with tooltip in it, what I exactly want to do is I need to set title for tooltip something like this using XTemplate:

tips = { 
    trackMouse: true,
    width: 120,
    height: 23,
    renderer: function(storeItem, item) {
        var myTemplate = new Ext.XTemplate('<p> {Value} </p>')
        myTemplate.overwrite(this.title, {
            Value : storeItem.get(Field)
        });
    }
}

But it is showing error like 'tagname' is null, can anyone give me solution for this. How can I get div id of that tips and how can I set title for tooltip?

Thanks

1

1 Answers

2
votes

Try this

Without XTemplate

renderer: function(storeItem, item) {
    this.setTitle(Ext.String.format('<p>{0}</p>', storeItem.get(**title field name**));
}

With XTemplate

renderer: function(storeItem, item) {
    var tpl = Ext.create('Ext.XTemplate', '<p>', '{Value}', '</p>');

    this.setTitle(tpl.apply({
        Value: storeItem.get(**title field name**)
    }));
}