Tag Archive for 'labelfunction'

21
Feb

Creating a custom label function on a Flex PopUpMenuButton control

The following example shows how you can use an XML data provider on a PopUpMenuButton in Flex and create a custom label function using the labelFunction property.

Full code after the jump.

Continue reading ‘Creating a custom label function on a Flex PopUpMenuButton control’

23
Jan

Displaying the labels vertically in Flex ColumnChart control

The following example shows how you can display the labels in a ColumnSeries either vertically or horizontally in a ColumnChart control in Flex by setting the Boolean showLabelVertically property.

Full code after the jump.

Continue reading ‘Displaying the labels vertically in Flex ColumnChart control’

11
Jan

Displaying the number of children in each branch of a Flex Tree control

The following example shows how you can display the number of children in each branch of a Tree control in Flex by using the dataDescriptor property, labelFunction property, hasChildren() method and getChildren() method.

Full code after the jump.

Continue reading ‘Displaying the number of children in each branch of a Flex Tree control’

09
Jan

Creating a custom label function on a Flex ButtonBar control

The following example shows how you can use a custom label function to create button labels on a ButtonBar control in Flex by setting the labelFunction property.

Full code after the jump.

Continue reading ‘Creating a custom label function on a Flex ButtonBar control’

12
Dec

Setting a custom label function on a Flex DateField control

The following example shows how you can format the displayed date in a DateField control by setting the labelFunction property and creating a custom label function.

Full code after the jump.

Continue reading ‘Setting a custom label function on a Flex DateField control’

03
Dec

Using an Array as a data provider in a Flex Tree control

The following code shows you how you can use an Array as a data provider for a Tree control in Flex.

Full code after the jump.

Continue reading ‘Using an Array as a data provider in a Flex Tree control’

30
Nov

Using the isBranch() method to determine if a Tree item is a branch or leaf

The following example shows how you can use the isBranch() method to determine if a specific node in a Tree control is a branch (folder) or leaf (item).

Full code after the jump.

Continue reading ‘Using the isBranch() method to determine if a Tree item is a branch or leaf’

25
Nov

Adding custom labels to a Flex ColumnChart control’s column series

The following example shows how you can create custom labels for a ColumnChart control’s ColumnSeries in Flex, as well as creating custom label functions for a linear axis and custom data tips for the ColumnChart control.

Full code after the jump.

Continue reading ‘Adding custom labels to a Flex ColumnChart control’s column series’

19
Nov

Alternating background column colors in a Flex LineSeries chart

In a previous example, “Alternating background row colors in a Flex LineSeries chart”, we saw how to alternate row colors in a LineSeries chart using the horizontalFill and horizontalAlternateFill styles.

In the following example, we see a similar technique for setting column background colors using the verticalFill and verticalAlternateFill styles, as seen in the following snippet:

<mx:LineChart showDataTips=true dataProvider={dp}>

    <mx:backgroundElements>
        <mx:GridLines direction=vertical>
            <mx:verticalFill>
                <mx:SolidColor color=haloBlue alpha=0.2 />
            </mx:verticalFill>
            <mx:verticalAlternateFill>
                <mx:SolidColor color=haloSilver alpha=0.2 />
            </mx:verticalAlternateFill>
        </mx:GridLines>
    </mx:backgroundElements>

    …

</mx:LineChart>

In this example, you also see examples of setting custom label functions for a LinearAxis and CategoryAxis, both of which we’ve seen examples of before (“Creating a custom label function on a Flex LineChart control’s linear axis” and “Creating a custom label function on a Flex LineChart control’s category axis” respectively) but it’s always fun to see a few of these things in a single example.

Full code after the jump.

Continue reading ‘Alternating background column colors in a Flex LineSeries chart’

16
Nov

Creating a custom label function on a Flex LineChart control’s category axis

The following example shows how you can create a custom label function on a CategoryAxis in a Flex LineChart control.

For an example of creating a custom label function for the vertical/linear axis, check out “Creating a custom label function on a Flex LineChart control’s linear axis”.

Full code after the jump.

Continue reading ‘Creating a custom label function on a Flex LineChart control’s category axis’

15
Nov

Creating a custom label function on a Flex LineChart control’s linear axis

The following example shows how you can create a custom label function on a LinearAxis in a Flex LineChart control.

For an example of creating a custom label function for the horizontal/category axis, check out “Creating a custom label function on a Flex LineChart control’s category axis”.

Full code after the jump.

Continue reading ‘Creating a custom label function on a Flex LineChart control’s linear axis’

04
Nov

Positioning labels in a Flex PieChart control

The following example shows how you can position callouts in a PieChart control’s pie series by setting the labelPosition style.

Full code after the jump.

Continue reading ‘Positioning labels in a Flex PieChart control’

29
Oct

Defining a custom label function on a Flex Tree control

The following example shows how you can specify a custom label function on a Tree control in Flex where the returned label is specific to the node name.

Full code after the jump.

Continue reading ‘Defining a custom label function on a Flex Tree control’

25
Sep

Creating a simple label function on a Flex ComboBox control

The following example shows how you can format the label in a ComboBox using a custom label function.

Full code after the jump.

Continue reading ‘Creating a simple label function on a Flex ComboBox control’

30
Jul

Formatting dates using the DateFormatter

Another basic little example showing how to format the text in a DateField control using the DateFormatter and the DateField control’s labelFunction property. This entry also shows the pretty basic trick of creating a separate ActionScript class file that holds the day names as constants so you don’t constantly have to think whether Monday is day 0 or day 1 (hint: it is day 1).

Full code after the jump.

Continue reading ‘Formatting dates using the DateFormatter’