加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flash图表FusionCharts如何自定义图表导出菜单或界面

发布时间:2020-12-15 17:59:12 所属栏目:百科 来源:网络整理
导读:FusionCharts的导出组件界面有两种模式: Compact Mode:?用于保存单张图片,每一个单独的导出组件实例都代表单独的图表。在这种模式下,只有一个按钮和标题是可见的。 Full Mode:?保存多个图表,无论是单独或作为一个单独的文件。在这种模式下,用户可以选择需要

FusionCharts的导出组件界面有两种模式:

Compact Mode:?用于保存单张图片,每一个单独的导出组件实例都代表单独的图表。在这种模式下,只有一个按钮和标题是可见的。

Full Mode:?保存多个图表,无论是单独或作为一个单独的文件。在这种模式下,用户可以选择需要保存的图表以及保存的格式。

在两种模式下,你可以自定义导出组件的颜色、字体和标题。在进入属性之前,先快速看一下导出组件的各种元素。如下图所示:


定制导出组件的属性

配置导出组件的属性时,同样需要在JavaScript中指定(其中的导出组件已经被初始化)。示例代码如下所示:

<div id="fcexpDiv" align="center">
     FusionCharts Export Handler Component
</div>
<script type="text/javascript">
     var myExportComponent = new FusionChartsExportObject("fcExporter1","../../FusionCharts/FCExporter.swf");

//Customize the component properties 
//Width and height
 myExportComponent.componentAttributes.width = '400';
 myExportComponent.componentAttributes.height = '60';
//Background color
 myExportComponent.componentAttributes.bgColor = 'ffffdd';
//Border properties
 myExportComponent.componentAttributes.borderThickness = '2';
 myExportComponent.componentAttributes.borderColor = '0372AB';
//Font properties
 myExportComponent.componentAttributes.fontFace = 'Arial';
 myExportComponent.componentAttributes.fontColor = '0372AB';
 myExportComponent.componentAttributes.fontSize = '12';
//Message - caption of export
 component myExportComponent.componentAttributes.showMessage = '1';
 myExportComponent.componentAttributes.message = 'Export the
   chart first,and then click on this button to save';
//Button visual configuration
 myExportComponent.componentAttributes.btnWidth = '200';
 myExportComponent.componentAttributes.btnHeight= '25';
 myExportComponent.componentAttributes.btnColor = 'E1f5ff';
 myExportComponent.componentAttributes.btnBorderColor = '0372AB';
//Button font properties
 myExportComponent.componentAttributes.btnFontFace = 'Verdana';
 myExportComponent.componentAttributes.btnFontColor = '0372AB';
 myExportComponent.componentAttributes.btnFontSize = '15';
//Title of button
 myExportComponent.componentAttributes.btnsavetitle = 'Save the chart'
 myExportComponent.componentAttributes.btndisabledtitle = 'Waiting for export'; 
//Render the exporter SWF in our DIV
 fcexpDiv myExportComponent.Render("fcexpDiv");
</script>

经过上面的操作之后,导出组件的各种参数就已经完成指定了。需要遵循以下语法:

Component_Instance.componentAttributes.Parameter_name = 'Value';

示例:

myExportComponent.componentAttributes.width = '400';

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读