COLOSSUS

Members
  • Content count

    1
  • Joined

  • Last visited

About COLOSSUS

  • Rank
    Forum Newbie
  1. Fusionchart dataURL method with DNN

    Rick, In my experience with DNN and FusionCharts, I found that the calling path was the problem that prevented the chart from rendering. Here's how I fixed it to make it work well with other portals: Firstly, my examples are in C# and I'm assuming that you are approaching this from a module programming standpoint. I am using the c# example "charting data from an array" from the documentation, so my solution will reference it. The first problem is that dnn does directories differently than other systems, so I place the FusionCharts folder with the js and flash files in the PORTAL root directory eg /portals/1/ this is essential for the rest to work. The dll still goes in the bin directory for the dnn application. Next, I had to tell the example code to look via the mapped path instead of ../. In the example code, find the line: return FusionCharts.RenderChart("../FusionCharts/FCF_Column3D.swf", "", strXML, "productSales", "600", "300", false, false); the path to the above swf won't work since it is in the PORTAL root now I handled it like this: string filepath = "http://" + PortalAlias.HTTPAlias + "/portals/" + PortalId.ToString() + "/FusionCharts/FCF_Column3D.swf"; return FusionCharts.RenderChart(filepath, "", strXML, "productSales", "600", "300", false, false); the above code will trace the existing portal path and find the elusive files. This is only step one. We need to do the same thing in the aspx file where the script tag lives Line in Example file: <SCRIPT LANGUAGE="Javascript" SRC="../FusionCharts/FusionCharts.js"></SCRIPT> Change: <SCRIPT LANGUAGE="Javascript" SRC="<%="http://" + PortalAlias.HTTPAlias + "/portals/" + PortalId.ToString() + "/FusionCharts/FusionCharts.js" %>"></SCRIPT> now the script will be found as well. In summary, DNN needs to know where to look to get files referenced in example code. I changed nothing other than these lines when I placed the CreateChart method into my existing module code. ALSO don't forget that if you are compiling c# with dnn, you will need to add the code directory to the web.config file to get it to compile. If you translate these concepts to VB there should be no issue. COLOSSUS