--- In [email protected], "Sherpa_Ed" <[EMAIL PROTECTED]>
wrote:
>
> Goal: Turn off axis lines and labels in ColumnChart
>
> Problem: Doesn't seem to work via AS3 (works fine in MXML)
>
> I can turn off the axis label without problem using:
> myAxisRenderer.setStyle("showLabels", "false");
>
> but I can't turn off the axis line when adding:
> myAxisRenderer.setStyle("showLine", "false");
>
>
> What am I doing wrong, or is it a bug?
>
> Thanks in advance,
> -Eddie
>
Here's sample code demonstrating the issue:
<?xml version="1.0"?>
<!-- charts/DisableAxisLines.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script><![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var expenses:ArrayCollection = new ArrayCollection([
{Month:"Jan", Profit:2000, Expenses:1500, Amount:450},
{Month:"Feb", Profit:1000, Expenses:200, Amount:600},
{Month:"Mar", Profit:1500, Expenses:500, Amount:300}
]);
private function doit():void {
fred.setStyle("showLine", "false");
fred.setStyle("showLabels", "false");
}
]]></mx:Script>
<mx:Panel title="Line Chart">
<mx:Button label="Click to Remove Line and Label" click="doit
()"/>
<mx:LineChart id="myChart" dataProvider="{expenses}"
showDataTips="true">
<mx:horizontalAxis>
<mx:CategoryAxis id="a1"
dataProvider="{expenses}"
categoryField="Month"
/>
</mx:horizontalAxis>
<mx:horizontalAxisRenderers>
<mx:AxisRenderer axis="{a1}" showLine="false"
showLabels="false"/>
</mx:horizontalAxisRenderers>
<mx:verticalAxisRenderers>
<mx:AxisRenderer id="fred" axis="{a1}" />
</mx:verticalAxisRenderers>
<mx:series>
<mx:LineSeries yField="Profit" displayName="Profit" />
<mx:LineSeries yField="Expenses"
displayName="Expenses" />
</mx:series>
</mx:LineChart>
<mx:Legend dataProvider="{myChart}"/>
</mx:Panel>
</mx:Application>