Sign in to follow this  
msdispose

Charts not rendering over HTTPS in IE (ASP)

Recommended Posts

Hi,

I've searched this and found it to be a topic discussed frequently, and I've read the page at http://www.fusioncharts.com/free/docs/Contents/Adv_SSL.html to try to resolve the problem, but no luck.  My chart renders fine over HTTP, but not in HTTPS.

I'm using FusionCharts Javascript class to embed the chart, and I'm using the dataXML method.

I've put the following code into my (classic ASP) .asp page that contains the "Call renderChart" statement:

<% Response.CacheControl = 'cache, must-revalidate" %>

<% Response.AddHeader "Pragma", "public" %>

<% Response.CacheControl = "cache, must-revalidate" %><% Response.AddHeader "Pragma", "public" %><% Response.Expires = -1 %><% Response.CacheControl = "cache, must-revalidate" %><% Response.CacheControl = "cache, must-revalidate" %><% Response.AddHeader "Pragma", "public" %><% Response.Expires = -1 %><% Response.AddHeader "Pragma", "public" %><% Response.Expires = -1 %>

But no luck...it works great on HTTP but not on HTTPS.  How can I get it working on HTTPS?

Thanks!

Share this post


Link to post
Share on other sites
Guest Madhumita

Hello,

After doing a through research I found that we can't modify the Cache-Control and Pragma header if it is set in IIS using ASP.NET code.

Even if we try to modify the headers then instead of overwriting the header our custom header gets appended to the existing header. There is no solution for this as of now.

 

So, when you are using SSL and DataURL method the simple solution is to use XMLHttpRequest Object in the HTML/JavaScript code and provide the DataURL path to that object, and render the chart at onreadystatechange event of XMLHttpRequest object but instead of using DataURL method we have to use DataXML method.

A simple example:

  1.  
  2. <div id="chartdiv" align="center">
  3.         FusionCharts. </div>
  4.       <script type="text/javascript">
  5.               var xmlHttp = new XMLHttpRequest();
  6.               xmlHttp.open('GET', 'https://localhost/xmlhand/Handler.ashx', true);
  7.               xmlHttp.onreadystatechange = function() {
  8.                    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
  9.                    var xdoc = xmlHttp.responseText;
  10.                    var sHTMLTag="<object codebase="https://download.macromedia.com/pub/sho ... on=6,0,0,0" classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" width="350" height="400">";
  11.                    sHTMLTag+="<param name="movie" value="Column2d.swf"></param>";
  12.                    sHTMLTag+="<param name="FlashVars" value="&dataXML=" + xdoc +""></param>";
  13.                    sHTMLTag+="<param name="quality" value="high"></param>";
  14.                    sHTMLTag+="<param name="WMode" value="Transparent"></param>";
  15.                    sHTMLTag+="<embed width="350" pluginspage="https://www.macromedia.com/go/getflashplayer" flashvars="&dataXML=" + xdoc + "" quality="high" height="400" name="FusionChart_StatisticsProject" type="application/x-shockwave-flash" wmode="transparent" src="Column2d.swf"></embed>";
  16.                    sHTMLTag+="</object>";
  17.                    document.getElementById("chartdiv").innerHTML=sHTMLTag;
  18.                }
  19.           }
  20.           xmlHttp.send(null);   
  21. </script>
  22.  

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