问题描述
尽管labelRotation属性设置为90此列图表中,轴标签是水平的。有没有我需要做一些额外的?
< MX:ColumnChart中的id =myChart高度=100%WIDTH =100%
的dataProvider ={} myData的
showDataTips =真正的>
< MX:水平轴>
< MX:类别时ID =H1categoryField =code/>
< / MX:水平轴>
< MX:horizontalAxisRenderers>
< MX:AxisRenderer将轴={H1}labelRotation =90/>
< / MX:horizontalAxisRenderers>
< MX:系列>
< MX:ColumnSet类型=堆叠
allowNegativeForStacked =真正的>
< MX:系列>
< MX:ColumnSeries的xField =code
yField =A
显示名=A/>
< MX:ColumnSeries的xField =code
yField =B的
显示名=B/>
< MX:ColumnSeries的xField =code
yField =C
显示名=C/>
< MX:ColumnSeries的xField =code
yField =D
显示名=D/>
< MX:ColumnSeries的xField =code
yField =F
显示名=F/>
< / MX:系列>
< / MX:ColumnSet>
< / MX:系列>
< / MX:ColumnChart中>
编辑:我试图嵌入字体,所建议的艾米和fotomut,但它并没有做任何事情:
< MX:样式>
@字体面
{
SRC:网址(../资产/字体/ FRABK.ttf);
fontFamily中:myFontFamily;
embedAsCFF:假的;
}
的ColumnChart
{
fontFamily中:myFontFamily;
字体:10;
}
< / MX:样式>
的关键,使得labelRotation工作嵌入字体。有关于Flex 4.6的好文章这里
一个简单的code例子是一个样式添加到MXML文件,
< FX:样式>
@namespace MX库://ns.adobe.com/flex/mx;
@字体面{
SRC:本地(宋体);
fontFamily中:宋体;
embedAsCFF:假的;
}
MX |的ColumnChart {
fontFamily中:宋体;
字体:10;
}
< / FX:样式>
编辑:我确认这适用于使用了我的Flex 3.5,通过简单地改变 FX:风格
到 MX:风格
< MX:样式>
@namespace MX库://ns.adobe.com/flex/mx;
@字体面{
SRC:本地(宋体);
fontFamily中:宋体;
embedAsCFF:假的;
}
MX |的ColumnChart {
fontFamily中:宋体;
字体:10;
}
< / MX:样式>
也许你应该尝试嵌入宋体喜欢这首,看看是否能工作?
Despite setting the labelRotation property to 90 in this column chart, the axis labels are horizontal. Is there something additional I need to do?
<mx:ColumnChart id="myChart" height="100%" width="100%"
dataProvider="{myData}"
showDataTips="true">
<mx:horizontalAxis>
<mx:CategoryAxis id="h1" categoryField="code"/>
</mx:horizontalAxis>
<mx:horizontalAxisRenderers>
<mx:AxisRenderer axis="{h1}" labelRotation="90" />
</mx:horizontalAxisRenderers>
<mx:series>
<mx:ColumnSet type="stacked"
allowNegativeForStacked="true">
<mx:series>
<mx:ColumnSeries xField="code"
yField="A"
displayName="A"/>
<mx:ColumnSeries xField="code"
yField="B"
displayName="B"/>
<mx:ColumnSeries xField="code"
yField="C"
displayName="C"/>
<mx:ColumnSeries xField="code"
yField="D"
displayName="D"/>
<mx:ColumnSeries xField="code"
yField="F"
displayName="F"/>
</mx:series>
</mx:ColumnSet>
</mx:series>
</mx:ColumnChart>
EDIT: I tried embedding the font, as suggested by Amy and fotomut, but it didn't do anything:
<mx:Style>
@font-face
{
src:url("../assets/fonts/FRABK.ttf");
fontFamily: myFontFamily;
embedAsCFF: false;
}
ColumnChart
{
fontFamily: myFontFamily;
fontSize: 10;
}
</mx:Style>
The key to making the labelRotation work is embedding of fonts.There is a good article on Flex 4.6 here
A simple code example would be to add a style to the mxml file,
<fx:Style>
@namespace mx "library://ns.adobe.com/flex/mx";
@font-face{
src: local("Arial");
fontFamily: Arial;
embedAsCFF: false;
}
mx|ColumnChart {
fontFamily: Arial;
fontSize: 10;
}
</fx:Style>
EDIT:I confirmed that this works for me using Flex 3.5, by simply changing fx:Style
to mx:Style
<mx:Style>
@namespace mx "library://ns.adobe.com/flex/mx";
@font-face{
src: local("Arial");
fontFamily: Arial;
embedAsCFF: false;
}
mx|ColumnChart {
fontFamily: Arial;
fontSize: 10;
}
</mx:Style>
Perhaps you should try embedding Arial like this first to see if that works?
这篇关于AxisRenderer将的labelRotation属性并不做任何事情的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!