Thank you...
Script:
public function setLabel(cat:Object, pcat:Object, ax:CategoryAxis,
catItem:Object):String
{
var label:String;
label = catItem.displayName.toString();
return label;
};
mxml:
<mx:verticalAxis>
<mx:CategoryAxis categoryField="ip" labelFunction="setLabel"/>
</mx:verticalAxis>
<mx:series>
< mx:BarSeries yField="ip" xField="errorIndex" displayName="Error
Index" styleName="{barColor()}"/>
</mx:series>
--- In [email protected], Maciek Sakrejda <msakre...@...> wrote:
>
> CategoryAxis.labelFunction, and use IP for the categoryField.
>
>
> -----Original Message-----
> From: flexnewbie06 <flexnewbi...@...>
> Reply-to: [email protected]
> To: [email protected]
> Subject: [flexcoders] Bar Chart Label - probably easy for most to
> resolve!!
> Date: Mon, 06 Apr 2009 18:54:24 -0000
>
> Hi all,
> I am wondering if it is possible to use a different field for the label
> than the one used in the axis category in a bar chart.
>
> To expand...
>
> <mx:verticalAxis>
> <mx:CategoryAxis categoryField="displayName">
> </mx:verticalAxis>
>
> <mx:series>
> <mx:BarSeries yField="ip" xField="errorIndex" displayName="Error Index"
> styleName="{barColor()}"/>
> </mx:series>
>
> I am trying to show a bar chart that shows a list of services delivered
> by their respect delivery %. I want the label field on the vertical axis
> to show the "display name" of the service but I want the bar series to
> be based on the "IP" of the service. If I try to use the display name of
> the service it backfires because sometimes there are duplicate services
> with the same name, then the bar chart just wigs out and draws those
> bars on top of each other. But there are never duplicate IP's so I'd be
> safe there. I just need clean labels.
>
> Obviously the above code doesn't work but that is where my brain is
> right now. Could anyone point me in the right direction.
>
> regards....
>