Results 1 to 5 of 5

Thread: Multiple tooltips in chart

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTGWT-3255 in 4.0.0 EA.
  1. #1
    Ext GWT Premium Member
    Join Date
    Jan 2012
    Location
    Belgium
    Posts
    220

    Default Multiple tooltips in chart

    Another remark:
    When I quickly hover over some points of three different series, I get three tooltips:

    scscreenshot120425004.png

    Shouldn't a previous tooltip disappear when another appears?
    (no matter if the new appearing tooltip is from the same or another series?)

    Another one:
    When two or more points of different series are on the same spot the appearing tooltips hide each other:

    scscreenshot120425005.png

  2. #2
    Sencha User
    Join Date
    Oct 2009
    Location
    Redwood City, California
    Posts
    402

    Default

    Please post only one bug in a given bug thread. Once we have a fix, we mark a ticket associated with your forum thread as "fixed" in our internal system. Your replies are liable to be missed when this happens.

    I've separated out your post into a separate thread.

  3. #3
    Sencha User
    Join Date
    Aug 2010
    Posts
    534

    Default

    I'm not sure this qualifies as a bug as that is expected behavior when using multiple tool tips http://sencha.com/examples/#ExamplePlace:tooltips. However if you wanted to only display one tool tip at a time you could have one ToolTip object that you show using the showAt method inside of the series item over event.

  4. #4
    Ext GWT Premium Member
    Join Date
    Jan 2012
    Location
    Belgium
    Posts
    220

    Default

    I'm not sure this qualifies as a bug as that is expected behavior when using multiple tool tips
    OK. I can live with that one.
    But then - if multiple tool tips is the expected behaviour - I consider my second remark as a bug.

    I think
    • OR you can only have one tool tip at a time
    • OR you can have mutiple but then they should be visible/readable simultaneously and not hide each other (since otherwise they're quite useless imo)

    Right?

  5. #5
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,178

    Default

    I've got a couple workarounds:

    1. First option uses the same tooltip configuration for all the series, depending on the last set.
    Code:
    final ToolTip newToolTip = new ToolTip(null);
    
    
    final LineSeries<Data> series = new LineSeries<Data>() {
      {
        toolTip = newToolTip;
      }
    };
    series.setToolTipConfig(new SeriesToolTipConfig<Data>());
    
    
    final LineSeries<Data> series2 = new LineSeries<Data>() {
      {
        toolTip = newToolTip;
      }
    };
    // use a custom label provider if needed...
    series.setToolTipConfig(new SeriesToolTipConfig<Data>());

    2. Second option, creates a tooltip for each series, and hides the other tooltip on show.
    Code:
    tooltip1 = new ToolTip(null) {
      @Override
      public void showAt(int x, int y) {
        super.showAt(x, y);
        tooltip2.hide();
        tooltip3.hide();
      }
    };
    
    
    tooltip2 = new ToolTip(null) {
      @Override
      public void showAt(int x, int y) {
        super.showAt(x, y);
        tooltip1.hide();
        tooltip3.hide();
      }
    };
    
    
    tooltip3 = new ToolTip(null) {
      @Override
      public void showAt(int x, int y) {
        super.showAt(x, y);
        tooltip1.hide();
        tooltip2.hide();
      }
    };
    
    
    final LineSeries<Data> series = new LineSeries<Data>() {
      {
        toolTip = tooltip1;
      }
    };
    // use a custom label provider if needed...
    series.setToolTipConfig(new SeriesToolTipConfig<Data>());
    
    
    final LineSeries<Data> series2 = new LineSeries<Data>() {
      {
        toolTip = tooltip2;
      }
    };
    // use a custom label provider if needed...
    series2.setToolTipConfig(new SeriesToolTipConfig<Data>());
    
    
    final LineSeries<Data> series3 = new LineSeries<Data>() {
      {
        toolTip = tooltip3;
      }
    };
    // use a custom label provider if needed...
    series3.setToolTipConfig(new SeriesToolTipConfig<Data>());
    Brandon

Posting Permissions

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