Álvaro González

Add line feed to tooltips

Recommended Posts

I'm using XT 3.3.1 to plot a Combination 3D (Simulated) Chart (Single Y) Specification Sheet chart (aka MSCombi3D.swf) with the JavaScript renderer.

 

Default tooltips are not very readable for me because everything's in one line and I'd like to add a carriage return to separate the three items. I've learn I can use the toolTipSepChar property under charts:

    "chart": {
        "formatNumberScale": 0,
        "decimalSeparator": ",",
        "thousandSeparator": ".",
        "toolTipSepChar": "test",
        "showToolTipShadow": 1,
        "toolTipBgColor": "EEEEEE",
        "toolTipBorderColor": "EEEEEE",
        "caption": "Nº de intervenciones × mes{br}2012—2013",
        "labelDisplay": "Rotate",
        "slantLabels": "1"
    },

The property itself works but I cannot find a way to insert a line ending. I've tried both '{br}' and a literal "\n" but they didn't work: the first one prints a literal '{br}' (it's funny because it does work in caption) and the second one prints a white space.

 

Is it possible to do what I want?

 

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

Could you please try once by providing the entire string of tooltip as toolText with {br} pseudo code, as shown below:

 

Ref. XML Code snippet:

<chart>
 <dataset>
  <set value='27400' ToolText='2006{br}Jan{br}$27.4K' />
  ...
 </dataset>
 ...
</chart>

Hope this helps!

Share this post


Link to post
Share on other sites

Could you please try once by providing the entire string of tooltip as toolText with {br} pseudo code, as shown below:

 

Ref. XML Code snippet:

<chart>
 <dataset>
  <set value='27400' ToolText='2006{br}Jan{br}$27.4K' />
  ...
 </dataset>
 ...
</chart>

 

Yes, {br} works in ToolText but not in toolTipSepChar I'm afraid.

 

Meanwhile, I've found a funny workaround:

'toolTipSepChar' => '<br>',

It feels like a bug but it works anyway.

Share this post


Link to post
Share on other sites

 Hey,

 

Try setting "isHTML" as 1 to "ToolTip" object and check if line feed works fine with "tooltipSepchar" attribute.

  "chart": {
       "tooltipsepchar": "<br>"
  },
 .......................................
  "styles": {
    "definition": [
      {
        "name": "style_1",
        "type": "font",
        "ishtml": "1"
      
      }
    ],
    "application": [
      {
        "toobject": "TOOLTIP",
        "styles": "style_1"
      }
    ]
  ...
}

Share this post


Link to post
Share on other sites
Try setting "isHTML" as 1 to "ToolTip" object and check if line feed works fine with "tooltipSepchar" attribute.

 

Thanks for your follow-up.

 

With your code I can enable/disable HTML in the tooltip (verified with a <strong> tag) but <br> is always rendered as a line feed, no matter the value of isHTML. As I said, it feels like a bug but serves as workaround for my issue.

Share this post


Link to post
Share on other sites

Thanks for your follow-up.

 

With your code I can enable/disable HTML in the tooltip (verified with a <strong> tag) but <br> is always rendered as a line feed, no matter the value of isHTML. As I said, it feels like a bug but serves as workaround for my issue.

Hi,

 

Glad that your issue is resolved.

 

Also, "tooltipSepChar" attribute use mentioned in the way described by Swarnam in a previous post is working correctly at our end. Please check with the screenshot for your reference.

 

post-8144-0-67507200-1389425723_thumb.jpg

 

Happy FusionCharting! :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now