Results 1 to 4 of 4

Thread: Styling Chart Tooltips

  1. #1
    Ext JS Premium Member
    Join Date
    Sep 2010
    Posts
    12
    Vote Rating
    1
      1  

    Question Unanswered: Styling Chart Tooltips

    I am having trouble styling chart tooltips. The first tooltip that says "Help" is the standard non-chart tooltip, styled with the x-tip style. The second is the tooltip that appears when you rollover a chart sprite. I would like to stype the second tooltip to look like the first.

    tooltip1.PNG tooptip2.PNG

    The code to add the tooptip to the chart is as follows:
    Code:
    tips: {
        trackMouse: true,
        anchorToTarget: true,
        hideDelay: 0,
        showDelay: 0,
        width: 500,
        height: 40,
        border: '0',
        renderer: function(storeItem, item){
           // calculate percentage.
          var total = 0;
          dataStore.each(function(rec){
              total += rec.get("yData");
          });
          this.setTitle(Math.round(storeItem.get("yData") / total * 100) + '% ' + ' ' + storeItem.get("xData"));
        }
    }
    Since the chart tooltips are rectangular sprites, can they be configured to the extent that the basic html tooltips are? It looks like the chart tooltip size is hard coded instead of variable depending on the length of the text. I tried leaving off the height and width, but this frequently caused to tooltip to be truncated.

    I tried setting baseCls, bodyCls which seemed to be ignored. Setting the body color with this

    Code:
    bodyStyle: 'background-color : yellow',
    resulted in only partially adding a background color, coloring only the bottom half of the tooltip rectangle.

    Has anyone been successful at styling the chart tooltips, starting with background color? If so, can you paste example code? What are the limitations on styling chart tooltips?
    Attached Images Attached Images

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,388
    Answers
    716
    Vote Rating
    499
      0  

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Location
    Washington DC
    Posts
    7
    Vote Rating
    0
      0  

    Default

    Is there anyway you can expose the suggestion. This thread is in the community section but the thread you are pointing to is in the premium and I am not an Ext JS Premium Member so I can not see the thread.

  4. #4
    Sencha User
    Join Date
    Jun 2010
    Posts
    1
    Vote Rating
    0
      0  

    Default

    I'd be interested too

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
  •