本人网上查找了很多资料,其中大部分都是关于Flash中的动画效果问题,与这里的问题关系型不太大。故把问题的解决方法写在这里,与人方便,与己方便。

方法一:

1.在自定义的widget中添加如下两个方法:

private function copyStyleFromParent(selector:String):void

{

var chartBaseStyle:CSSStyleDeclaration = styleManager.getStyleDeclaration(selector);

if (!chartBaseStyle && styleManager.parent)

{

var parentStyle:CSSStyleDeclaration = styleManager.parent.getStyleDeclaration(selector);

if (parentStyle)

{

styleManager.setStyleDeclaration(selector, parentStyle, false);

}

}

}

protected function preinitializeHandler ():void

{

var styleObjects:Array =new Array();//FlexGlobals.topLevelApplication.styleManager.selectors;

styleObjects.push( "mx.charts.chartClasses.ChartBase" );

styleObjects.push( "mx.charts.chartClasses.CartesianChart" );

styleObjects.push( "mx.charts.chartClasses.PolarChart" );

styleObjects.push( "mx.charts.BarChart");

styleObjects.push( "mx.charts.ColumnChart" );

styleObjects.push( "mx.charts.LineChart");

styleObjects.push( "mx.charts.PieChart");

styleObjects.push( "mx.charts.AxisRenderer" );

styleObjects.push( ".blockCategoryAxis");

styleObjects.push( ".blockNumericAxis");

styleObjects.push( ".linedNumericAxis");

styleObjects.push( ".dashedNumericAxis");

styleObjects.push( ".dashedCategoryAxis");

styleObjects.push( ".hangingCategoryAxis");

styleObjects.push( "mx.charts.GridLines");

styleObjects.push( ".horizontalGridLines");

styleObjects.push( "mx.charts.series.BarSeries" );

styleObjects.push( "mx.charts.series.ColumnSeries" );

styleObjects.push( "mx.charts.series.LineSeries" );

styleObjects.push( "mx.charts.series.PieSeries" );

for each(var styleObj:String in styleObjects) {

                             

copyStyleFromParent(styleObj);

}

}

  2.在该自定义widget头部中添加preinitialize="preinitializeHandler ()" 。

方法二:

在自定义widget中覆盖父类的moduleFactory方法:

  override public function get moduleFactory():IFlexModuleFactory {

    return FlexGlobals.topLevelApplication.moduleFactory;

  }

在自定义的widget中引入图表后,运行时出现TypeError #1009错误的更多相关文章

  1. 报错:此版本的SQL Server Data Tools与此计算机中安装的数据库运行时组件不兼容

    在Visual Studio 2012中使用Entity Framework,根据模型生成数据库时,报如下错误: 无法在自定义编辑器中打开Transact-SQL文件此版本的SQL Server Da ...

  2. c++ 程序编译后运行时的内存分配

    程序编译后运行时的内存分配 太好的文章了,看到不得不转,转自:http://blog.sina.com.cn/s/blog_5420e0000101a0w1.html 一.编译时与运行时的内存情况 1 ...

  3. 为什么一定要调用 setlocale 呢? 因为在 C/C++ 语言标准中定义了其运行时的字符集环境为 "C" ,也就是 ASCII 字符集的一个子集。使用setlocal改变整个应用程序的字符集编码方式(wcstombs使用前要设置 setlocale (LC_ALL, "chs"); )

    setlocale 配置地域化信息. 语法: string setlocale(string category, string locale); 返回值: 字符串 函数种类: 操作系统与环境   内容 ...

  4. ios 引入第三方库 运行时找不到函数实现

    今天引入webtrends 这个库,结果一直运行时找不到函数,纳闷了一下午! 后来发现,是other flag没有设置对,对于那些包含category用来扩展ios原始类型的库,链接的时候需要特别的链 ...

  5. 关于Java项目打包成Runnable jar文件后运行时图片不显示的问题

    现象:在eclipse中能够无误运行,但导出Runnable jar后运行jar包时不显示图片. 原因:路径问题. 方法1: 新建一个文件夹.文件夹中放那个jar包和image文件夹.在这种情况下,双 ...

  6. WP8.1中C++的winodws运行时组件位移操作的差异

    最近学习WP8.1应用开发,想把C语言的SM3国密算法移植到手机app中.由于把C语言的代码转换成C#代码工作量较大,因此只能用winodws运行时组件来实现. SM3国密算法是一种HASH算法,具体 ...

  7. Java中获取类的运行时结构

    获取运行时类的完整结构 通过反射获取运行时类的完整结构 Field(属性).Method(方法).Constructor(构造器).Superclass(父类).Interface(接口).Annot ...

  8. Springboot 项目中引入WebSocket后,单元测试出现错误

    报错信息 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test. ...

  9. 如何解决weblogic server启动中在IIOP后运行缓慢

    WebLogic Server在Linux环境中,有时因为linux OS的安全包没有安装,导致weblogic server 在启动的时候会在长时间的停留在 <2/07/2009 08:54: ...

随机推荐

  1. 解决Cannot download "https://github.com/sass/node-sass/releases/download/binding.nod的问题

    npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/

  2. JS高级---案例:贪吃蛇小游戏

    案例:贪吃蛇小游戏 可以玩的小游戏,略复杂,过了2遍,先pass吧 先创建构造函数,再给原型添加方法.分别创建食物,小蛇和游戏对象. 食物,小蛇的横纵坐标,设置最大最小值,运动起来的函数,按上下左右键 ...

  3. Angular 2.0 文本拖拽

    基于Angular7.1和TypeScript实现 Html代码 <div style="padding-left: 0px;"> <div id='conten ...

  4. vue入门基础知识点测试

    vue入门基础知识点测试 1.文本(值绑定){{var}}----控制<div></div>的值显示当前时间,且1秒更新一次.(可查阅 setinterval 函数,时间Dat ...

  5. C#中的switch

    switch 表达式支持的类型为 sbyte.byte.short.ushort.int.uint.long.ulong.char.string 或枚举类型,或者可以隐试转换到这些类型的自定义对象或其 ...

  6. 每日扫盲(五):RPC(Remote Procedure Call)

    作者:洪春涛链接:https://www.zhihu.com/question/25536695/answer/221638079来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注 ...

  7. Python学习之Craps赌博游戏篇

    在此先安利一波大佬的Python学习项目地址:https://github.com/jackfrued/Python-100-Days 这些天一直在看着大佬的项目学习Python,这是第五天循环学习完 ...

  8. 简单桶排序(Bucket Sort)

    1.基本思想 桶排序是将待排序集合中处于同一个值域的元素存放在同一个桶中1. 2.算法设计2 假设有一个班级有5个人,这次期末他们分别考了5分,2分,4分,5分,8分(满分为10分).需要将这些分数从 ...

  9. angular2 单元测试 路由相关

    第一步:在html模板中,写路由链接,并保证有路由出口 第二步:写自定义的路由指令和路由出口组件,因为在单元测试中不需要引入真实的路由,此处我们用虚拟的代替即可. 第三步:将自定义的虚拟路由指令和路由 ...

  10. 微信小程序云函数中有以下未安装的依赖,如果未安装即全量上传

    云函数中有以下未安装的依赖,如果未安装即全量上传 在新建的云函数,右击终端打开->cmd,安装依赖 npm install --production 依赖安装成功之后,文件里面会出现 packa ...