修改flex chart中Legend的字体样式
最近在弄FLEX的图表, 发现CHART 中的Legend 的字体通过直接设置Style 并没有办法改变字体大小.
google 了下, 发现了这个方法: 通过派生LegendItem类,并设置Legend的ItemClass属性来实现。
LegendItem 是Lengend 的元素, 就是里面一个一个的图示. 通过派生这个类, 就可以修改其相应的样式.
派生LegendItem 类, 并设置样式.
BigFontLegendIte.as
package com
{
import mx.charts.LegendItem;
public class BigFontLegendItem extends LegendItem
{
public function BigFontLegendItem()
{
super();
this.styleName = "<STRONG>ChineseFont</STRONG>
";
}
}
}
2. 然后定义样式, 在 Legend 中直接指定legendItemClass 为 BigFontLegendIte
<mx:Style>
.<STRONG>ChineseFont</STRONG>
{
fontFamily:"Verdana","宋体";
fontSize:12;
}
</mx:Style>
<mx:Legend legendItemClass="com.BigFontLegendItem " />
这样就可以设置Legend 中的字体大小或者样式了.
相关文档:
<?xml version="1.0"?>
<!-- Simple example to demonstrate the ProgressBar control. -->
<!--
如何使用Flex ProgressBar
MyShareBook.cn 翻译
-->
<mx:Applic ......
在Flex应用中常常需要以一定的格式来显示时间,以下是一种做法。
首先创建一个DateFormatter 控件
<mx:DateFormatter id="df" formatString="YYYY-MM-DD JJ:NN:SS"/>
formatString="YYYY-MM-DD JJ:NN:SS"指定了时间的格式为2009-6-20 19:02:27,这里可以设置成自己需要的格式。
然后写个函数
......
http://www.k-zone.cn/zblog/post/flex-compiler-parameter.html
下面的列表提供了mxmlc的一些可选参数:
属性
描述
accessible=true|false
是否具有可理解性
actionscript-file-encoding
设置文件编码
advanced | mxmlc -help advanced
检索mxmlc高级参数
allow-source-path-overlap=true|false
验证source-pat ......
丢失静默错误(SILENT ERROR)
在某些情形下,绑定操作似乎不能正常工作,此时你可能非常懊恼并且不知道如何进行处理。
由绑定表达式抛出的、或在绑定框架调用的绑定函数中出现的异常和错误可以被静默捕获。因此,你将不会看到运行时异常,而这在 Flash Player 的调试版本中是能够看到的。这时,不仅绑定操作不能工作,而 ......
原来是这样,
我一开始用的是flex_sdk_3.4.1.10084(Stable Builds),(由于sdk3.5有combobox的bug),但是在用RSL的时候,发现flash player 的AssetCache里就是没有swz,
原因是:我用的sdk是Stable Builds,它是没有swz的,
官网的解释是:
The Flex team dos not currently create signed versions of the major RSL ......