Sign in to follow this  
Jonathan

Label With A Link

Recommended Posts

Hello!

 

I have created a MSBar3D chart and it works fine as it is, but i would to make the labeltext a simple link.

I researched some and found an example which looked like this: <category label="<a href='http://www.fusioncharts.com'> Jan </a>" />

but when i try the same i get the error invalid data.

This is the xml i am using:

<chart caption='Business Results: 2005' yAxisName='Revenue (Millions)' canvasBgColor='FEFEFE' canvasBaseColor='FEFEFE' toolTipBgColor='DEDEBE' toolTipBorder='889E6D' divLineColor='999999'

showColumnShadow='0' divLineIsDashed='1' divLineDashLen='1' divLineDashGap='2' numberPrefix='$' numberSuffix='M' chartRightMargin='30'>

<categories>

<category label='<a href='http://www.fusioncharts.com'> Jan </a>'/>

<category label='Software' /><category label='Service' />

</categories>

<dataset seriesname='Domestic' color='8EAC41'>

<set value='84' />

<set value='207' />

<set value='116' />

</dataset>

<dataset seriesname='International' color='607142' >

<set value='116' />

<set value='237' />

<set value='83' />

</dataset>

</chart>

 

It works if i use this string for the label:

<category label='<a href='http://www.fusioncharts.com'> Jan </a>'/>

But the label looks as follows and is not a link:

<a href='http://www.fusioncharts.com'> Jan </a>

 

How should the link in the label be written for it to work properly?

/Jonathan

Share this post


Link to post
Share on other sites

Hello

 

The example i was talking about in my first post was exactly the same as you gave me now, and it wont work.

I am probably doing something wrong.

 

/Jonathan

 

 

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thanks for your response.

 

You would need to apply STYLES in order to make it work.

 

Your XML code is missing the STYLE part.

 

Also, you would need to encode some special characters like: <category label="<a href='http://www.fusioncharts.com'> Jan </a>" />

 

Hope this helps.

Share this post


Link to post
Share on other sites

Hello

 

It was my intetion to provide an encoded link in my first post but i guess something went wrong so i will do it now instead.

 

The chart renders when i use this in the XML code: <category label='< ;a href=' ;http://www.fusioncharts.com' ;> ; Jan < ;/a> ;'/>

But the label dont become a link instead it just displays the whole text as following on the chart: <a href='http://www.fusioncharts.com'> Jan </a>

 

On a sidenote:

Are you sure that I need styles to make it work?

I still dont have the styles tags and it renders now.

 

/Jonathan

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thanks for your response.

 

Yes, the chart would render without the STYLE, but you would need to use it in order to make the label as link.

 

Please find the screenshots attached for your reference.

 

Hope this helps.

post-10517-0-70036800-1323777741_thumb.png

post-10517-0-18534200-1323777789_thumb.png

Share this post


Link to post
Share on other sites

Hello again!

 

I have encountered a new problem related to links in labels.

 

The problem appears when i have long labels, and the fusioncharts trims the label and inserts three dots (Long Labe...) .

 

It seems that fusioncharts wont translate the html tags when this happens.

So if i have a label looking like this: '<a href='http://www.fusioncharts.com'> Jan </a>'

it will display the text Jan in the chart and be a link to http://www.fusioncharts.com.

 

But when the label is long and the chart starts to display ellipses it will still display the correct label but it is not a link anymore

and when the toolText displays '<a href='http://www.fusioncharts.com'> Jan </a>'.

I tried to set the flag useEllipsesWhenOverflow to 0 but it wont solve the problem.

 

Are the isHtml style not compatible with any type of "label overflow"?

Or am I doing something wrong?

 

/Jonathan

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thanks for your response.

 

Could you please send us the XML code to look into the issue?

 

Awaiting for your response.

 

 

 

Share this post


Link to post
Share on other sites

Hello

 

I attached an example xml which produces the problem, it is not the actual xml I am using.

The problem appears on the label with the name ___________________Long label____________________

 

I am using a MSBar3D chart and the height and width are both 500.

 

/Jonathan

ExampleXML.xml

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