Tag Archives: getColorName()

Changing default line colors in a Flex LineChart control

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.

Continue reading Changing default line colors in a Flex LineChart control

Converting color names to numbers using the StyleManager class

The following examples show how you can convert color names (such as “red”, “haloSilver”, “#FFFFFF”, and “0xFFFF00”) into numeric values, using the StyleManager class’s static getColorName() method and getColorNames() method.

Full code after the jump.

Continue reading Converting color names to numbers using the StyleManager class