Sign in to follow this  
Pallav

Include link in Y axis name

Recommended Posts

I am using asp.net, C# with fusion charts. I am using the dataXML method to generate chart. All functionalities work great, but I am unable to give '<' character in XML data.

I want to give a hyper link with in the Y-axis name, which on clicking should open a page. That is, I have to give '<a>' tag in the 'yAxisName' attribute of chart element. I have tried the escape characters for < such as '<', '<' but none helped. If the xml contains a '<' or equivalent code of that character it shows 'Invalid XML' error.

Is there a way that I can embed a link in yAxisName attribute value?

Thanks.

Share this post


Link to post
Share on other sites

You'll need to use dataURL method and then encode < as < Also, you'll need to convey to the chart that y-axis name would be HTML (using STYLES).

Share this post


Link to post
Share on other sites

When I use the dataURL method, the graph is not properly displayed when viewed from remote machines. The URL of xml file is specified correctly. The graph always shows ChartNoDataText message. In local machine, the graph is properly displayed.

What could be wrong?

Share this post


Link to post
Share on other sites

I am using ASP.net code to dynamically create the xml data for generating chart. While using dataXML method everything was working as expected. But I have to switch to dataURL method inorder to use '<' for embedding html tags.

So I saved the dynamically created XML data to an XML file, 'data.xml' in root folder, to use in dataURL method. The result of RenderChartHTML method is output to a Literal control in the aspx page using the following C# code:

ltrChart.Text = infosoftglobal.FusionCharts.RenderChartHTML(ApplicationPath + "/FusionCharts/StackedBar3D.swf?PBarLoadingText=Rxploring...&ChartNoDataText=No Data Available for Your Selection", ApplicationPath + "data.xml", "", "CategoryNumber", "540", "470", false);

But it always displays the message 'No Data Available for Your Selection'. 

The dynamically created sample XML data is pasted below:

 

<chart caption="Drug Regimen Adverse Reaction Profile" legendShadow="1" xAxisName="Effects - Summary" yAxisName="Rxplore Score <a href="test.aspx" target="_blank">(What's This?)</a>" baseFontSize="10" baseFontColor="808080" showValues="0" numberPrefix="">

- <categories>

  <category label="Insomnia" />

  <category label="nausea" />

  <category label="headache" />

  <category label="dry mouth" />

  <category label="Dyspepsia" />

  <category label="Throat discomfort" />

  <category label="Agitation" />

  <category label="dizziness" />

  <category label="palpitations" />

  <category label="back pain" />

  </categories>

- <dataset seriesName="Allegra-D 24 Hour">

  <set value="12.6" toolText="Up to 12.6%25 of patients taking Allegra-D 24 Hour experienced Insomnia compared with 0.0%25 of patients taking a placebo." />

  <set value="7.4" toolText="Up to 7.4%25 of patients taking Allegra-D 24 Hour experienced nausea compared with 0.0%25 of patients taking a placebo." />

  <set value="3.1" toolText="Up to 10.6%25 of patients taking Allegra-D 24 Hour experienced headache compared with 7.5%25 of patients taking a placebo." />

  <set value="2.8" toolText="Up to 2.8%25 of patients taking Allegra-D 24 Hour experienced dry mouth compared with 0.0%25 of patients taking a placebo." />

  <set value="2.8" toolText="Up to 2.8%25 of patients taking Allegra-D 24 Hour experienced Dyspepsia compared with 0.0%25 of patients taking a placebo." />

  <set value="2.3" toolText="Up to 2.3%25 of patients taking Allegra-D 24 Hour experienced Throat discomfort compared with 0.0%25 of patients taking a placebo." />

  <set value="1.9" toolText="Agitation occurred in > 2%25 of patients taking Allegra-D 24 Hour" />

  <set value="1.9" toolText="dizziness occurred in > 2%25 of patients taking Allegra-D 24 Hour" />

  <set value="1.9" toolText="palpitations occurred in > 2%25 of patients taking Allegra-D 24 Hour" />

  <set value="1.4" toolText="Up to 2.8%25 of patients taking Allegra-D 24 Hour experienced back pain compared with 1.4%25 of patients taking a placebo." />

  </dataset>

- <styles>

- <definition>

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

  <style name="myHTMLFont1" type="font" bold="1" isHTML="0" />

  </definition>

- <application>

  <apply toObject="TOOLText" styles="myHTMLFont1" />

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

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

  </application>

  </styles>

  </chart>

Another problem is that I am not able to use RenderChart method with Ajax. This method requires complete page refresh to generate chart. It was a very useful method as I could avoid the 'Click to activate this control' message by using this method. So I am using RenderChartHTML method.

Thanks.

Edited by Guest

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