Results 1 to 4 of 4

Thread: Styling Chart Tooltips

Threaded View

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

    Question 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

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
  •