From the category archives:

LineSeries

The following example shows how you can change the line colors in a LineChart in Flex by setting the lineStroke style in MXML or ActionScript, as seen in the following snippets:

MXML:

<mx:LineSeries id="closeSeries" yField="@close" form="curve" displayName="Close">
    <mx:lineStroke>
        <mx:Stroke color="haloGreen" weight="2" alpha="0.6" />
    </mx:lineStroke>
</mx:LineSeries>

ActionScript:

<mx:LineSeries id="closeSeries" yField="@close" form="curve" displayName="Close" />
...
closeSeries.setStyle("lineStroke", new Stroke(0xFF0000, 2, 0.4));

Full code after the jump.

[click to continue…]

{ 4 comments }

The following example shows how you can remove the default drop shadow from a LineChart chart in Flex by setting the seriesFilters property, as seen in the following snippets:

<mx:LineChart id="lineChart"
        showDataTips="true"
        dataProvider="{dp}"
        width="100%"
        height="100%"
        seriesFilters="[]">

    <!-- . . . -->

</mx:LineChart>
<mx:LineChart id="lineChart"
        showDataTips="true"
        dataProvider="{dp}"
        width="100%"
        height="100%">

    <!-- series filters -->
    <mx:seriesFilters>
        <mx:Array />
    </mx:seriesFilters>

    <!-- . . . -->

</mx:LineChart>

Full code after the jump.

[click to continue…]

{ 0 comments }

The following example creates a simple LineChart in Flex 3 and lets you toggle the baseAtZero property which controls whether the minimum or maximum chart value should be set to zero. Since a sample is worth 1000 words, read on.

Full code after the jump.

[click to continue…]

{ 0 comments }