[CLOSED] Adding line series tooltip dynamically.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [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.

      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 5:13 AM. Reason: [CLOSED]

Similar Threads

  1. Replies: 13
    Last Post: Apr 26, 2016, 11:11 PM
  2. [CLOSED] [#8] Chart: Hide Line Series values
    By cwolcott in forum 2.x Premium Help
    Replies: 12
    Last Post: Mar 14, 2013, 6:41 AM
  3. [CLOSED] Line series broken with javascript error
    By jchau in forum 2.x Premium Help
    Replies: 3
    Last Post: Mar 04, 2013, 11:04 AM
  4. Replies: 3
    Last Post: Jul 13, 2012, 11:28 AM
  5. [CLOSED] Dynamic Hyperlink adding HTML Line break after
    By rthiney in forum 1.x Premium Help
    Replies: 2
    Last Post: Apr 13, 2010, 3:09 PM

Posting Permissions