locked
Exporting Fusion charts in ASP.Net RRS feed

  • Question

  • User462755366 posted

    Hi,

    How can export fusion charts to an image. I have tried the following but it is creating blank image.  But the graph is been plotted well.

    ……………………………………………………………………………………………..

    LiteralClosedDefectsTrend.Text = lGraphXML; // This is graph xml been generated

     

    lFnDownloadGraph(lGraphXML);

     

    void lFnDownloadGraph(string aStrXMLGraph)

            {

                try

                {

                    SWFToImage.SWFToImageObject lObjswfobj = new SWFToImage.SWFToImageObject();

                    lObjswfobj.InitLibrary("demo", "demo");

                    lObjswfobj.InputSWFFileName = Server.MapPath("FusionCharts/") + "FCF_MSColumn3D.swf";

     

                    string lStrNeededEtx = "jpg";

     

                    string lStrSelectedExtn = "";

     

     

                    if (lStrNeededEtx == "jpg")

                    {

                        lObjswfobj.ImageOutputType = TImageOutputType.iotJPG;

                        lStrSelectedExtn = ".jpg";

                    }

                    else

                    {

                        if (lStrNeededEtx == "gif")

                        {

                            lObjswfobj.ImageOutputType = TImageOutputType.iotGIF;

                            lStrSelectedExtn = ".gif";

                        }

                        else

                        {

                            if (lStrNeededEtx == "png")

                            {

                                lObjswfobj.ImageOutputType = TImageOutputType.iotPNG;

                                lStrSelectedExtn = ".png";

                            }

                            else

                            {

                                if (lStrNeededEtx == "bmp")

                                {

                                    lObjswfobj.ImageOutputType = TImageOutputType.iotBMP;

                                    lStrSelectedExtn = ".bmp";

                                }

                            }

                        }

                    }

     

                    string lStrFilenm = "FCF_StackedColumn3D" + lStrSelectedExtn;

                    lObjswfobj.Execute_Begin();

                   

     

                    lObjswfobj.Execute_SetVariable("dataXML", aStrXMLGraph);

     

                    lObjswfobj.Execute_SetVariable("chartWidth", "750");

                    lObjswfobj.Execute_SetVariable("chartHeight", "600");

     

                    lObjswfobj.ImageWidth = 600;

                    lObjswfobj.ImageHeight = 500;

     

                    lObjswfobj.Execute_GetImage();

     

                    string lFilePath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

     

                    lObjswfobj.SaveToFile(lFilePath + @"\" + lStrFilenm);

                    lObjswfobj.Execute_End();

                    //DownloadImage(lStrFilenm);

                }

                catch (Exception)

                {

     

                    throw;

                }

            }

     

    ……………………………………………………………………………………………..

    Any Help on this please.

    Tuesday, May 31, 2011 1:44 AM

All replies

  • User-1583970805 posted

    Hi,

    below link may be helpful for you

    http://stackoverflow.com/questions/5003472/how-to-export-a-fusionchart-to-image-in-asp-net

    Regards,

    Mansoor

    Tuesday, May 31, 2011 6:47 AM