Sign in to follow this  
Guest Basundhara Ghosal

How to insert line breaks on displayValue attribute of line (trendline)

Recommended Posts

I have a rather long displayValue for a horizontal trend line. Is there a way to insert a line break?

For example:

<line startValue='1' valueOnRight='1' displayValue='This is line 1. I want this on line 2.' />

Share this post


Link to post
Share on other sites

Thank Pallev, but I already tried that. Does not render the <BR> as HTML.

I did creat the style definition from the demo code and applied it to both TRENDLINES and TRENDVALUES with no luck.

Share this post


Link to post
Share on other sites

Please try this. It works for us here:

<trendlines>
  <line startValue='1' valueOnRight='1' displayValue='This is line 1. <BR>I want this on line 2.' />
 </trendlines>
 <styles>
  <definition>
	 <style name='myHTMLFont' type='font' isHTML='1' />
  </definition>
  <application>
	 <apply toObject='TRENDVALUES' styles='myHTMLFont' />
  </application>
  </styles>

Share this post


Link to post
Share on other sites

I've just tried a multi-line tooltext, and that doesn't work either. There are no examples of such in the galleries, so there's no working example to learn from. I get "invalid XML" if I try to insert <BR>

 

 

 

Here's a snippet from the XML:

 

 

 


 

 

 

Removal of <br> fixes it up.

Share this post


Link to post
Share on other sites

Okay, so the code / code thing doesn't work (or at least not as I expected). So here's the offending line with the brackets removed:

 

 

 

set value='1.8' toolText='11.2s, <br>1.8MPH, 3526.0RPM, 95.3%25'

Share this post


Link to post
Share on other sites

If you're using the dataXML method, there would be a conflict between the < specified in the XML, the actual XML element lt opening sign and the HTML lt sign to embed the chart.

So, you need to use this in dataURL method.

Share this post


Link to post
Share on other sites

If you want to use the dataXML method, I found that you need to URL encode the ampersand( & ) :

%26lt;br%26gt;

instead of:

<br>

It works for me, but I know that FusionCharts also does not like the '%' operator in the XML, so you may still receive an 'Invalid XML Data' error with this method. I just know it worked for me. I'm using C# with ASP.NET 2.0 and I'm randomly generating my XML as strings in the Code-Behind before I push out to the client.

Hope this helps...

Edited by Guest

Share this post


Link to post
Share on other sites

Ok, now I understand. I did not require the use of the '%' character for the code I mentioned. To use the '%' the way you are referring, Pallav, yes that is how I would need to use it. However, the '%' character in the code I provided above is used to encode the '&' character where by '&' --> %26.

This allowed me to use the above method to put HTML in my trendlines using the dataXML method and not the dataURL method.

Edited by Guest

Share this post


Link to post
Share on other sites

I have tried to replicate this but have been unsuccessful.

I am using FusionMaps, and have included the following XML (using dataURL method):

<styles>

 <definition>

<style name="myHTMLFont" type="font" isHTML="1" />

 </definition>

 <application>

<apply toObject="TOOLTIP" styles="myHTMLFont" />

 </application>

</styles>

Map entities have toolText="line one <br> line two"

...but line breaks do not render.  They are being parsed, however, because my toolTip renders as "line one line two", without the <br> tag (which does display if I set isHTML="0").

toolText="<b> bold text </b>" correctly renders as bold text.  <p> and <br> tags, however, do not produce any effect.

Help!

Neil

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi,

Glad that your issue is resolved.

Thanks for your appreciation.

Keep smiling and keep FusionCharting. :)

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi,

Glad your isuue is resolved.

Keep smiling and keep 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
Sign in to follow this