无法在 Fusion Charts v3 中保存图像

发布于 2024-10-31 01:43:31 字数 2115 浏览 3 评论 0原文

我已使用 Fusion Charts v3 API 成功创建了 2D 饼图。以下是我的 HTML 文件:

<html>
  <head>        
    <title>My First chart using FusionCharts</title>    
    <script type="text/javascript" src="FusionCharts.js">
    </script>
    <script type="text/javascript" src="FusionChartsExportComponent.js">
    </script>

  </head>   
  <body>     
    <div id="chartContainer"></div>          
    <script type="text/javascript">         

      var myChart = new FusionCharts( "Pie2D.swf", 
      "myChartId", "500", "500", "0", "1" );
      myChart.setXMLUrl("age-demographics.xml");
      myChart.render("chartContainer");


    </script>     

    <div id="fcexpDiv" align="center">FusionCharts Export Handler Component</div>
     <script type="text/javascript"> 
        //Render the export component in this     
        //Note: fcExporter1 is the DOM ID of the DIV and should be specified as value of exportHandler      
        //attribute of chart XML.      
        var myExportComponent = new FusionChartsExportObject("fcExporter1", "FCExporter.swf");
        myExportComponent.debugMode = true;
        //Render the exporter SWF in our DIV fcexpDiv      
        myExportComponent.Render("fcexpDiv");   
    </script>
  </body> 
</html>

这是我的 XML 文件:

<chart caption='Age Demographics' showPercentValues='1' exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' showExportDataMenuItem='1'>
    <set label='3-11' value='0' />
    <set label='12-17' value='5' />
    <set label='18-25' value='99' />
    <set label='26-34' value='65' />
    <set label='35-49' value='0' />
    <set label='50+' value='5' />
</chart>

正如 Fusion Charts 文档中所述,我的文件夹中有以下文件:

FCExporter.swf
FusionCharts.js
FusionChartsExportComponent.js
highcharts.js
jquery.min.js
Pie2D.swf

我无法将图像导出并保存为 jpeg/png/pdf。 “捕获”过程启动并完成至 100%,但我没有看到任何弹出的“另存为”窗口。我的Flash版本是10.2.x。

请帮忙。

I have successfully created a 2D Pie Chart using Fusion Charts v3 API. Following is my HTML file :

<html>
  <head>        
    <title>My First chart using FusionCharts</title>    
    <script type="text/javascript" src="FusionCharts.js">
    </script>
    <script type="text/javascript" src="FusionChartsExportComponent.js">
    </script>

  </head>   
  <body>     
    <div id="chartContainer"></div>          
    <script type="text/javascript">         

      var myChart = new FusionCharts( "Pie2D.swf", 
      "myChartId", "500", "500", "0", "1" );
      myChart.setXMLUrl("age-demographics.xml");
      myChart.render("chartContainer");


    </script>     

    <div id="fcexpDiv" align="center">FusionCharts Export Handler Component</div>
     <script type="text/javascript"> 
        //Render the export component in this     
        //Note: fcExporter1 is the DOM ID of the DIV and should be specified as value of exportHandler      
        //attribute of chart XML.      
        var myExportComponent = new FusionChartsExportObject("fcExporter1", "FCExporter.swf");
        myExportComponent.debugMode = true;
        //Render the exporter SWF in our DIV fcexpDiv      
        myExportComponent.Render("fcexpDiv");   
    </script>
  </body> 
</html>

and this is my XML file :

<chart caption='Age Demographics' showPercentValues='1' exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' showExportDataMenuItem='1'>
    <set label='3-11' value='0' />
    <set label='12-17' value='5' />
    <set label='18-25' value='99' />
    <set label='26-34' value='65' />
    <set label='35-49' value='0' />
    <set label='50+' value='5' />
</chart>

I have the following files in my folder as said in the Fusion Charts Documentation:

FCExporter.swf
FusionCharts.js
FusionChartsExportComponent.js
highcharts.js
jquery.min.js
Pie2D.swf

I am unable to export and save the image as jpeg/png/pdf. The "capture" process initiates and completes itself to 100% but I don't see any popup "save-as" window. My flash version is 10.2.x.

Please help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

善良天后 2024-11-07 01:43:31

我尝试了你的代码,它在这里对我来说效果很好。导出组件的保存按钮在捕获完成后启用。

我认为问题出在您机器上的闪存全局设置上。

从 FusionCharts 文档中,

运行客户端示例时,请确保已将示例(以及 ../FusionCharts 文件夹)复制粘贴到您的服务器(本地主机或远程)。它们无法在本地文件系统上工作的原因是,出于安全原因,Adobe Flash Player 会阻止本地文件系统上的 Flash 与 JavaScript 通信,而 FusionCharts 使用该通信进行客户端导出。如果您需要覆盖特定文件夹的该设置,则需要访问 http: //www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html,然后在该界面中将包含我们的示例的文件夹添加到允许的文件夹列表中。

访问闪存全局设置站点并允许访问特定文件夹或整个驱动器的闪存。这应该可以解决你的问题。

I tried out your code and it works fine for me here. The save button of the export component gets enabled after capturing is completed.

I think that the problem is with flash global settings on your machine.

From the FusionCharts documentation,

When running client-side examples, make sure that you've copied-pasted the examples (along with ../FusionCharts folder) to your server (either localhost or remote). The reason why they would not work on local files system is that Adobe Flash Player blocks Flash to JavaScript communication on local file system for security reasons, which FusionCharts uses for client-side exporting. If you need to over-ride that for a specific folder, you'll need to visit http://www.macromedia.com/support/documentation/en/flash player/help/settings_manager04.html and then in that interface add the folder containing our examples to the list of allowed folder.

Visit the flash global settings site and allow access to flash for the specific folder or for the whole drive. This should solve your problem.

风尘浪孓 2024-11-07 01:43:31

捕获过程完成后,您将不会看到任何“另存为窗口”。您的导出组件的“保存”按钮将被启用,或者导出组件的列表将被填充。

You won't see any "save as window" after the capture process is complete. Your Export Component' Save button would get enabled or the Export Component's list would get populated.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文