Results 1 to 2 of 2

Thread: D3 SVG tooltips

  1. #1
    Sencha User
    Join Date
    Apr 2017
    Posts
    7
    Answers
    1

    Default Answered: D3 SVG tooltips

    I'm having difficulty adding tooltips to a custom D3 SVG bar chart. I followed the guide here: https://docs.sencha.com/extjs/6.5.2/...ml#cfg-tooltip, but the tooltip renderer function never gets called. I use D3 to generate the bars in a bar chart and would like to have tooltips on each bar. I'd like to use ExtJS tooltips to keep it consistent with other charts in my app.

    View:
    Code:
    Ext.define('App.chart.Histogram', {
        extend: 'Ext.d3.svg.Svg',
        alias: 'widget.app-chart-histogram',
    
        mixins: [
            'Ext.d3.mixin.ToolTip'
        ],
    
        defaultListenerScope: true,
        listeners: {
            sceneresize: 'renderChart'
        },
    
        tooltip: {
            renderer: function (component, tooltip, datum, element, event) {
                console.log('Tooltip: ', arguments);
            }
        },
    
        renderChart: function (chart, scene) {
           ...
           // D3 code to render bar chart
        }

  2. Nevermind, I got it working by putting the tooltip config in the class config block:

    Code:
        config: {
            tooltip: {
                renderer: function (component, tooltip, node, element) {
                    console.log('in renderer', arguments);
                }
            }
        },

  3. #2
    Sencha User
    Join Date
    Apr 2017
    Posts
    7
    Answers
    1

    Default

    Nevermind, I got it working by putting the tooltip config in the class config block:

    Code:
        config: {
            tooltip: {
                renderer: function (component, tooltip, node, element) {
                    console.log('in renderer', arguments);
                }
            }
        },

Similar Threads

  1. tooltips
    By Huasheng06 in forum Ext: Q&A
    Replies: 5
    Last Post: 2 Jan 2012, 7:23 AM
  2. Use of tooltips
    By iNes14 in forum Ext: Q&A
    Replies: 2
    Last Post: 14 Dec 2011, 6:20 AM
  3. tooltips
    By diegolovison in forum Ext GWT: Discussion
    Replies: 4
    Last Post: 1 Apr 2010, 11:05 AM
  4. Big Tooltips?
    By asbalaji in forum Sencha Ext JS Q&A
    Replies: 9
    Last Post: 21 Nov 2008, 8:55 AM
  5. [DUP] [2.2] Tooltips in IE7
    By mankz in forum Ext 2.x: Bugs
    Replies: 1
    Last Post: 5 Aug 2008, 1:22 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •