woodykiddy

Members
  • Content count

    24
  • Joined

  • Last visited

Posts posted by woodykiddy


  1. Hi,

     

    Automatic saving of a chart can be done, you would need to use "addEventListener" method as the chart gets rendered.

     

    For live example, refer this link: http://docs.fusionch...rSide/Auto.html

     

    What if I have multiple charts that need to be exported automatically to the server? Can I call addEventListener multiple times in Javascript?

     

    I will give it try first. Thanks for the suggestion.

     

     

     


  2. Hi,

     

    You can export multiple chart which are rendered in the same page.

     

    You can achieve this, by using batch export functionality.

     

    The Batch mode is useful when you have multiple charts on a page and you want to export all of them together by calling a JavaScript API.

     

    The exported files for each chart can either be saved individually, or all the exported charts can be saved as a single file.

     

    For enabling export of chart in Batch mode, you would need to assemble the following elements:

     

    >> The chart itself embedded using FusionCharts JavaScript class (FusionCharts.js).

     

    >> FusionCharts Export Component - This is named FCExporter.swf and is present in Download Package > Charts. You need to copy-paste this SWF to your server. A good location will be to place this SWF along with your chart SWFs.

     

    >> FusionCharts Export Component JavaScript class - This JavaScript class is named FusionChartsExportComponent.js and is present in Download Package > Charts folder. Place it where you have placed FusionCharts.js on your website (though not necessary, but this helps you centralize all FusionCharts related JS files)

     

    You would also need to set following attributes in the XML file under the chart element:

     

    exportEnabled='1'

    exportAtClient='1'

    exportHandler='fcBatchExporter' (name of the export handler)

     

    For more information please refer the following link:

    http://docs.fusionch...BatchSetup.html

     

    Also, please find attached illustration for your reference.

     

    Thanks very much for the reply and attached sample code.

     

    From the sample code, I noticed that we had to click the Save button so that we could save individual chart image.

     

    I am just wondering if there is any way that we can automate this "saving image" process. I mean, it'd be really nice if individual chart image can be saved directly onto the server disk.

     

    So can we possibly achieve this? Thanks


  3. Hi,

     

    I have a javascript function which accepts chartID parameter, and calls exportChart(). The code is as follows:

     

     

       function ExportChartToImg(chartid) {
               var chartObject = getChartFromId(chartid);
    
               if (chartObject != null && chartObject.hasRendered()) {
                   chartObject.exportChart();
               }
    
       }

     

     

    It works perfectly for page that only contains 1 chart object. But, what if I have multiple chart objects on a web page? Can I still re-use the above logic and export chart like this? (Assume multiple chartid is represented in this format: chart1|chart2|chart3|...)

     

     

       function ExportChartToImg(chartid) {
           var arr = new Array();
           arr = chartDomID.split("|");
    
           for(var i=0; i< arr.length; i++){
               chartid = arr[i];
               var chartObject = getChartFromId(chartid);
               alert(chartObject + " - " + i);
               if (chartObject != null && chartObject.hasRendered()) {
                   chartObject.exportChart();
               }
           }
       }

     

     

    I was expecting to get chart exported multiple times (because of the for loop), but as a matter of fact, I was only able to have first one exported, hence the chart object (chart2) couldn't exported successfully.

     

    So what should I do to be able to export multiple charts with JS? Can anyone help me, please? Thanks.


  4. Hi. smile.gif

     

    I am afraid, I could not replicate the same.

     

    The above mentioned error might be related to your IIS server.

     

    Please, try to set proper path for 'FCExporter.aspx' file in the XML file.

     

    And also, please make necessary changes in the 'FCExporter.aspx.cs' file as below:

     

    private const string SAVE_PATH = "./";

     

    private const string HTTP_URI = "http://localhost:1549/"; - (directory for saving the exported image.)

     

     

    Please find attached screenshot for your reference with this reply.

     

    Hope this helps. smile.gif

     

    Thanks for all the replies. I finally managed to solve the problem by re-installing the .net framework. The exportChart() is definitely issue-free. I can export the images now. Thanks very much, guys.


  5. Hi Thanks for test code. But I think I am still having the issue.

     

    Issue:

     

     

    Parser Error
    
    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 
    
    Parser Error Message: Could not load type 'FCExporter'.
    
    Source Error: 
    
    
    Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeFile="FCExporter.aspx.cs" Inherits="FCExporter" %>

     

     

    If I switch back to ASP.NET11 export handler, I will get the same error msg as the one in my first post.

     

    Also I have deliberately create a test folder under my root website directory and put the following files inside.

     

    FCExporter.aspx, FCExporter.aspx.cs, FusionCharts.js, FusionChartsExportComponent.js, testFC.asp (my test file) , Data.xml, Column3D.swf

     

     

    test.zip


  6. Hi Thanks for test code. But I think I am still having the issue.

     

    Issue:

     

     

    Parser Error
    
    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 
    
    Parser Error Message: Could not load type 'FCExporter'.
    
    Source Error: 
    
    
    Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeFile="FCExporter.aspx.cs" Inherits="FCExporter" %>

     

     

    If I switch back to ASP.NET11 export handler, I will get the same error msg as the one in my first post.

     

    Also I have deliberately create a test folder under my root website directory and put the following files inside.

     

    FCExporter.aspx, FCExporter.aspx.cs, FusionCharts.js, FusionChartsExportComponent.js, testFC.asp (my test file) , Data.xml, Column3D.swf

     

     

    BTW, how can I attach files here. I have got my version of test code ready.


  7. Hi :)

     

    Could you please download the latest version of FusionCharts i.e FusionCharts XT Service Release 2

     

    Please refer the following link for download:

    http://www.fusioncha...ownload/trials/

     

    Also try to use new ExportHandlers from FusionCharts XT Service Release 2 version.

     

    And see if this helps?

     

    Hope you have a great day. :)

     

    Can you please attach fusioncharts.js file directly in here? My fusionCharts.js version is fusioncharts/3.2.3-release.4749. Not sure if it's the latest version or not.

     

    Also I re-downloaded the latest version, but still that didn't solve my problem. I got the same error messages returned from export handler:

     

    DOMId=
    height=0
    width=0
    fileName=
    statusMessage=Insufficient data.statusCode=0

     

     

    I don't understand what else I am missing here. :(


  8. Hi :)

     

    Apologies for the delay.

     

    I am afraid, I am unable to comprehend the issue.

     

    Can you send us, relevant sample code of your issue?

     

    It would be helpful for us to look into the issue.

     

    I basically used the same piece of code as the one we saw in the FusionCharts Doc.

     

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
       <title>Untitled Page</title>
       <script type="text/javascript" src="Charts/FusionCharts.js"></script>
       <script type="text/javascript">
           function ExportMyChart() {
               //var chartObject = getChartFromId('myChartId');
               var chartObject = FusionCharts("myChartId");
               //alert(chartObject.getXMLData());  //test to see if chartObject created or not
               if (chartObject.hasRendered()) chartObject.exportChart();
           }
    
         </script>
    </head>
    <body>
       <div id="chartContainer">FusionCharts will load here!</div>          
    
       <script type="text/javascript">
           var myChart = new FusionCharts("Charts/Column3D.swf", "myChartId", "400", "300", "0", "1");
           myChart.setXMLUrl("Charts/Data.xml");
           myChart.render("chartContainer");
       </script>
    
       <script type="text/javascript">
           //Callback handler method which is invoked after the chart has saved image on server.
           function FC_Exported(objRtn) {
               if (objRtn.statusCode == "1") {
                   alert("The chart was successfully saved on server. The file can be accessed from " + objRtn.fileName);
               } else {
                   alert("The chart could not be saved on server. There was an error. Description : " + objRtn.statusMessage);
               }
           }
       </script>        
       <input type="button" onclick="ExportMyChart()"
           value="Export Chart to Image" id="btnExportChart" />
    </body>
    </html>

     

     

    And XML code for chart attributes

    <chart exportHandler="http://mywebsite/Charts/ExportHandlers/ASP_Net11/FCExporter.aspx" exportEnabled="1" exportAtClient="0" exportAction="save" caption="Sales Summary" subCaption="For the year 2010" numberPrefix="$" sformatNumberScale="1" sNumberPrefix="$" syncAxisLimits="1" rotateValues="1" showSum="0">
    

     

    But somehow it just doesn't export properly. I wonder, would there be any restrictions to call exportChart() JS function? Why it doesn't send stream to .NET export handler?

     


  9. I was going to export chart to image and save it on the server. But it just didn't work. I believe there must be an error / a problem with the following js function:

     

    var chartObject = FusionCharts("myChartId");

    chartObject.exportChart(); // <= it fails badly

     

    This then causes the problem on the Export Handler, which will produce the following server error:

     

    DOMId=

    height=0

    width=0

    fileName=

    statusMessage=Insufficient data.

    statusCode=0

     

     

    As far as I understand, it is saying that the chart stream data has not been posted to the server (i.e. Request["stream"] is NULL ), which is why the export handler doesn't recognise the chart and save it to image.

     

    This issue has been bugging me for many hours, and I have tried looking for solutions on the forum but all in vain. So please kindly advise a proper solution to this issue. Thanks.

     

    EDIT:

     

    By the way, I have also tried both .NET chart export handlers with correct configurations, but no luck getting chart exported.


  10. Oh and here is the complete version of my XML data file for plotting the chart. I'd appreciate it if you can run through this one again for me to see if it's okay. Many thanks.

     

    Hi,

     

    I am afraid, we are unable to replicate the issue, the code is working fine from our end.

     

    Could you please enable the debug mode in your html code and send us the screenshot?

     

    ex: var my chart=new FusionCharts("FusionCharts/MSLine.swf", "myID", "600", 400", "1","1");

     

    Awaiting for your reply.

     

     

     

     

    full.xml


  11. I set the debug mode true in the following line

     

    Call renderChartHTML("charts/Charts/MSLine.swf", "", chXmlSGC, "2lines", "100%", "200", true)

     

    Oops, here was the error the debugger told me:

     

    ERROR: Invalid number specified in XML. FusionCharts can accept number in pure numerical form only. If your number formatting (thousand and decimal separator) is different, please specify so in XML. Also, do not add any currency symbols or other signs to the numbers.

     

    Is this stopping vLine working properly?

     

    Hi,

     

    I am afraid, we are unable to replicate the issue, the code is working fine from our end.

     

    Could you please enable the debug mode in your html code and send us the screenshot?

     

    ex: var my chart=new FusionCharts("FusionCharts/MSLine.swf", "myID", "600", 400", "1","1");

     

    Awaiting for your reply.

     

     

     

     


  12. Thanks for the reply.

     

    But I am afraid it didn't help too much because that's exactly what I did to my chart.

     

    "<vLine color='FF5904' label='Start' labelHAlign='left' labelVAlign='top' thickness='3' showLabelBorder='1' />"

     

     

    I don't think there're typos in the above line of code, and all attributes were used according to the chart xml api. So now I am kinda clueless. Perhaps it could be a bug or sth??

     

     

     

    Hi,

     

    Welcome to FusionCharts Forum!smile.gif

     

    Please refer to the link for more details: http://www.fusioncha...e.html#Anchor17

     

    Hope this helps.smile.gif


  13. Hey everyone,

     

    I have a little problem with the vLine object. I was working on multi-series line chart and I could see the vertical line cross over it, but whenever I wanted it to display labels, it always failed. I have even tried toolTip, text, toolText attributes, still no luck. Can anyone help? Thanks.


  14. Hi,

     

    I seem to have a problem with setTransparentChart() function. It gave me the following error - "Type mismatch: 'setTransparentChart'" whenever I call it in my asp page. So does anyone have any idea how to solve this problem?

     

    I'd appreciate any help

     

    Ha, sorry about double posting but I managed to solve the problem now, and it was simple. Just add wmode="transparent" in the <embd> tag and it will set background to transparent.