Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6877881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:39:17+00:00 2026-05-27T04:39:17+00:00

The data provider for the chart contains an array of facility objects. A facility

  • 0

The data provider for the chart contains an array of facility objects. A facility object is made of several parts indicating the installation ID, facility number and facility name as shown below:

{
   installationID:1000,
   facilityNum:529,
   facilityName:"Building1"
}

I have a chart that depicts energy consumption per building. There may be buildings shown in the chart from several different regions. I want to:

  1. Group all the buildings in the same region together.
  2. Include a region label only when it starts a new group.
  3. Align the label parts in a grid such that:
    • All region labels are left aligned with each other.
    • All Building IDs are right aligned with each other.
    • Building names are left aligned with each other.

An example of the desired output it shown in the image below.

Desired Formatting

Using a custom label function applied to the category axis I can concatenate the values into one string. By sorting the array region ID and I can even remove (not add) the region ID unless a new group is starting. The custom label function is shown here.

private var nextCategoryIndex:int = 1;

public function facilitiesLabelFunction(categoryValue:Object, previousCategoryValue:Object, axis:CategoryAxis, categoryItem:Object):String
{
   var nextInstallationID:String = "";
   var facilitiesColl:ArrayCollection = ArrayCollection(axis.dataProvider);

   // if this is not the last facility to be processed get the next installation ID
   if (nextCategoryIndex <= facilitiesColl.length - 1) {
      nextInstallationID = facilitiesColl[nextCategoryIndex].installationID;
   }

   var label:String = categoryItem.facilityNum + " - " + categoryItem.facilityName;

   // preppend the installation id when we start listing facilities from a different installation
   if (nextInstallationID != categoryItem.installationID) {
      label = categoryItem.installationID + " " + label;
   }

   nextCategoryIndex++;
   return label;
}

However, this generates a singular string that is right aligned (as expected). What I want to achieve is the left, right, left alignment of the three properties as described above.

I attempted to concatenate the property values in the label function with an ‘@’ as as delimiter. The thinking was that I could create custom label renderer that would split the string on this delimiter and perform the alignment as needed. However, I do not seem to be able to change the alignment of a label within a custom label renderer.

How can I align multi-part labels in a grid like fashion in a Flex Chart?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:39:17+00:00Added an answer on May 27, 2026 at 4:39 am

    I don’t know of any multi-part label capabilities in Flex, but you can create item renderers that would contain and align any number of labels (or other components) in the manner you want. Something like this should work (not complete or tested, but should point you in the right direction):

    <mx:BarChart>
        <mx:AxisRenderer>
            <mx:labelRenderer>
                <fx:Component>
                    <s:Group width="300">
                        <s:Label left="0" text="{data.leftvalue}" />
                        <s:Label horizontalCenter="0" text="{data.centervalue}" />
                        <s:Label left="right" text="{data.rightvalue}" />
                    </s:Group>
                </fx:Component>
            </mx:labelRenderer>
        </mx:AxisRenderer>
    </mx:BarChart>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The data provider (ArrayCollection) for my data grid consists of objects with ByteArray (int)
I am trying to get the DB2 data provider from a 32-bit .Net application
Background: I'm writing a data provider that SSAS will use to get data from
I have an ADO.NET Managed Data Provider that is registered in machine.config in DbProviderFactory
I use Oracle's specific data provider (11g), not the Microsoft provider that is being
Does anyone know whether there's a way to mock Entity Data Provider so Unit
In my C# application I am using the Microsoft Jet OLEDB data provider to
I'm in need of a functional OleDB data provider for PostgreSQL. It should be
I'm looking for a third-party Oracle Data Provider for .Net (ADO.NET) with a full
I am constructing a combination chart from an ajax json object consisting of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.