请flex高手解决,module嵌入字体不显示问题,跪谢!

hello_world_hello 2010-10-25 11:35:56
代码如下:
<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" creationComplete="init()" >
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;

[Bindable]
public var expenses:ArrayCollection=new ArrayCollection(
[{Month: "2008-01-02 10:17:24", Profit: 2000, Expenses: 1500, Amount: 450},
{Month: "Beb", Profit: 100, Expenses: 200, Amount: 600},
{Month: "Deb", Profit: 500, Expenses: 200, Amount: 600},
{Month: "Eeb", Profit: 700, Expenses: 200, Amount: 600},
{Month: "Feb", Profit: 300, Expenses: 200, Amount: 600},
{Month: "Geb", Profit: 400, Expenses: 200, Amount: 600},
{Month: "Heb", Profit: 200, Expenses: 200, Amount: 600},
{Month: "Ieb", Profit: 600, Expenses: 200, Amount: 600},
{Month: "Jeb", Profit: 800, Expenses: 200, Amount: 600},
{Month: "Keb", Profit: 900, Expenses: 200, Amount: 600},
{Month: "Leb", Profit: 1200, Expenses: 200, Amount: 600},
{Month: "Meb", Profit: 1500, Expenses: 200, Amount: 600},
{Month: "Neb", Profit: 2000, Expenses: 200, Amount: 600},
{Month: "Oeb", Profit: 3000, Expenses: 200, Amount: 600},
{Month: "Peb", Profit: 2500, Expenses: 200, Amount: 600},
{Month: "Qeb", Profit: 900, Expenses: 200, Amount: 600},
{Month: "Reb", Profit: 1000, Expenses: 200, Amount: 600},
{Month: "Seb", Profit: 1400, Expenses: 200, Amount: 600},
{Month: "Teb", Profit: 1300, Expenses: 200, Amount: 600},
{Month: "Ueb", Profit: 1800, Expenses: 200, Amount: 600},
{Month: "Veb", Profit: 2200, Expenses: 200, Amount: 600},
{Month: "Web", Profit: 2400, Expenses: 200, Amount: 600},
{Month: "Xeb", Profit: 2600, Expenses: 200, Amount: 600},
{Month: "Yeb", Profit: 1700, Expenses: 200, Amount: 600},
{Month: "Zeb", Profit: 1300, Expenses: 200, Amount: 600},
{Month: "Aer", Profit: 1500, Expenses: 500, Amount: 300}]);

//[Embed(source="style/arial.ttf",fontName="MyVerdana")]
private var _verdana:Class;

function init():void{
myChart.styleName="myLineChart";

}
]]>
</mx:Script>
<mx:Style>
@font-face {
/**src:url("arial.ttf");
embedAsCFF:false;
font-family: EmbeddedArial;
src:local('arial');
font-family:DefineArial;
unicodeRange: U+0041-U+005A, U+0061-U+007A, U+002E;

*/
src:local('arial');
font-family: myArial;
}
.myLineChart{
/**font-family:DefineArial;
font-family:Candara;

*/
font-family: myArial;
font-size:15px;
}
</mx:Style>
<mx:Panel title="线性图表测试" width="100%">
<mx:LineChart id="myChart" dataProvider="{expenses}" showDataTips="true" width="100%">
<mx:seriesFilters>
<mx:Array/>
</mx:seriesFilters>
<mx:horizontalAxis>
<mx:CategoryAxis
categoryField="Month"/>
</mx:horizontalAxis>
<mx:horizontalAxisRenderer>
<mx:AxisRenderer canDropLabels="true" labelRotation="-50"/>
</mx:horizontalAxisRenderer>
<mx:series>
<mx:LineSeries
yField="Profit"
displayName="Profit"
/>
</mx:series>
</mx:LineChart>
<mx:Legend dataProvider="{myChart}"/>
<mx:LineChart id="myChart2" dataProvider="{expenses}" showDataTips="true" width="100%">
<mx:seriesFilters>
<mx:Array/>
</mx:seriesFilters>
<mx:horizontalAxis>
<mx:CategoryAxis
categoryField="Month" />
</mx:horizontalAxis>
<mx:horizontalAxisRenderer>
<mx:AxisRenderer canDropLabels="true" labelRotation="-70"/>
</mx:horizontalAxisRenderer>
<mx:series>
<mx:LineSeries
yField="Profit"
displayName="Profit"
/>
</mx:series>
</mx:LineChart>
<mx:LineChart id="myChart3" dataProvider="{expenses}" showDataTips="true" width="100%">
<mx:seriesFilters>
<mx:Array/>
</mx:seriesFilters>
<mx:horizontalAxis>
<mx:CategoryAxis
categoryField="Month"/>
</mx:horizontalAxis>
<mx:horizontalAxisRenderer>
<mx:AxisRenderer canDropLabels="true" labelRotation="-45"/>
</mx:horizontalAxisRenderer>
<mx:series>
<mx:LineSeries
yField="Profit"
displayName="Profit"
/>
</mx:series>
</mx:LineChart>
</mx:Panel>
</mx:Module>

module中第一个图表的x、y轴的的数据显示。application中正常。
...全文
259 点赞 收藏 15
写回复
15 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
没有解决,我现在用的是open flash chart
回复
adwfcu 2010-11-25
请问同志你的在model里labelRotation倾斜度显示解决了?

我也碰到了你这样的问题
回复
fw176170847 2010-11-25
看看是不是domain的问题
回复
去掉@font-face {
/**src:url("arial.ttf");
embedAsCFF:false;
font-family: EmbeddedArial;
src:local('arial');
font-family:DefineArial;
unicodeRange: U+0041-U+005A, U+0061-U+007A, U+002E;

*/
src:local('arial');
font-family: myArial;
}
这段代码,还能实现x轴的lable选择吗?
就是为了实现这个功能才加入了嵌入字体这段代码的
嵌入字体在application中能够正常显示,但是在module了中就不能显示x、y轴的数据了
回复
在Application中labelRotation 嵌入字体是有效的,问题是在module中就不行了
回复
水中影子 2010-10-25
我也遇到相同问题,还没解决,

期待高手!
回复
niwenbin416 2010-10-25
可以用啊LZ!

myChart.styleName="myLineChart";//这个去了吧加了实在丑

3.2的SDK
回复
水中影子 2010-10-25
在Application中labelRotation 嵌入字体有效,晕!
回复
水中影子 2010-10-25
可以正常显示,但是labelRotation倾斜度无效

flex SDK3.2依然无效
回复
leemiki 2010-10-25
楼上3.5可以???

我用3.2,上面那段去掉才可以正常显示!

可能是SDK的版本问题!
回复
水中影子 2010-10-25
刚测试了你的代码,可以显示,没问题

我的环境 Flex SDK3.5
回复
leemiki 2010-10-25
@font-face {
/**src:url("arial.ttf");
embedAsCFF:false;
font-family: EmbeddedArial;
src:local('arial');
font-family:DefineArial;
unicodeRange: U+0041-U+005A, U+0061-U+007A, U+002E;

*/
src:local('arial');
font-family: myArial;
}

这段设置有问题~~~ 去掉就好了
回复
module中第一个图表的x、y轴的的数据不显示
回复
相关推荐
发帖
Flex
创建于2007-12-13

4328

社区成员

多媒体/设计 Flex
申请成为版主
帖子事件
创建了帖子
2010-10-25 11:35
社区公告
暂无公告