开发者

Flex DateTimeAxis not showing labels

I have a chart that uses a DateTimeAxis for the x-axis and a renderer defined for it. I also have a function defined for the label on the axis but I am not able to get the labels to show.

Trying to print out a static time to test working.

private function timeAxisLabelFunction(obj1:Object, obj2:Object, axis:IAxis):String
{
    return "9:30AM";
}


<mx:AreaChart
        id="alertVolumeChart"
        width="100%"
        height="100%"
        dataProvider="{volumes}"
        showDataTips="true" >
    <mx:horizontalAxis>
        <mx:DateTimeAxis id="xAxis" 
                 dataUnits="minutes"
                 baseAtZero="false"
                 alignLabelsToUnits="false"
                 interval="8" 
                 minorTickInterval="1" 
                 labelFunction="timeAxisLabelFunction"/>

    </mx:horizontalAxis>
    <mx:horizontalAxisRenderers>
        <mx:AxisRenderer 
            id="hAxisRenderer" canDropLabels="false"
                        axis="{xAxis}" showLabels="true"
                        labelFunction="timeRendererLabelFunction"
                        minorTickLength="8" minorTickPlacement="outside"
                        tickLength="20" tickPlacement="outside"
                        labelAlign="right" labelGap="4"
                        tickStroke="{timeStroke}" minorTickStroke="{timeStroke}" axisStroke="{timeStroke}" >
        </mx:AxisRenderer>
    </mx:horizontalAxisRenderers>

    <mx:series>
        <mx:AreaSeries
            yField="value" xField="time">   
        </mx:AreaSeries>        
    </mx:series>

</mx:AreaChart>

Update:

Apparently, the font family I was using doesnt support a font style that is used in the renderer. Not sure what style attr开发者_StackOverflow中文版ibute it is yet.


The problem was with the font family i was trying to use. It was not compatible with the renderer so I needed to embed the same font again but with embedAsCFF: false;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜