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 8313409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:28:56+00:00 2026-06-08T20:28:56+00:00

I’m missing something fundamental about charting in Flex. I’m creating a custom chart component

  • 0

I’m missing something fundamental about charting in Flex. I’m creating a custom chart component that includes an autoscale function, which modifies the chart’s x-axis and y-axis limits, and provides a new data series for the chart. The custom chart component looks like:

<s:Group ...>
   ...
   private function autoScale():void {
       ...
       // this is where I compute newXmin, newXmax, newYmin, newYmax, startIndex, endIndex
       ...
       haxis.minimum = newXmin;
       haxis.maximum = newXmax;
       vaxis.minimum = newYmin;
       vaxis.maximum = newYmax;
       myChart.series.dataProvider = myData.slice(startIndex, endIndex+1);
   }
   ...
   <mx:LineChart id="myChart">

       <mx:horizontalAxis>
           <charts:MyAxis id="haxis" labelFunction="setXLabels()"/>
       </mx:horizontalAxis>

       <mx:verticalAxis>
           <mx:LinearAxis id="vaxis" labelFunction="setYLabels()"/>
       </mx:verticalAxis>

   </mx:LineChart>
   ...
</s:Group>

At any time, the user may zoom in/out (code not shown), which calls the autoScale() function.

My thinking, correct me if I’m wrong, is that the above program re-draws the chart FIVE times (once for each line of code shown in function autoScale(). Is it possible to tell Flex to ignore re-drawing changes to the component until I issue some specific command that says, “OK, now I’ve set everything I need to — go ahead and redraw the chart”?

I’ve been reading about invalidateDisplayList, but haven’t been able to figure out if this is the intended application for it, and if so, how to apply it here. I’ve only ever seen invalidateDisplayList applied to custom components in the set and get functions used to pass data in/out of the custom component (see here, for example). In my example above, the properties I’m discussing are all set inside the custom component (e.g. in the autoScale() function). Not sure if that makes a difference.

Any advice appreciated.

  • 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-06-08T20:28:58+00:00Added an answer on June 8, 2026 at 8:28 pm

    Flex’s component lifecycle would prevent chart being redrawn 5 times because the properties are modified 5 times with in the statements as you described, that’s the beauty of the lifecycle.

    In short, most properties change don’t right away translate to drawing, but instead a flag is raised indicating that property has changed, such process is called invalidation. The component would then wait until the next redraw cycle, typical a frame after (Flash is a frame-based animation environment). When redraw happens, the code can then evaluate all situations holistically.

    Flex’s lifecycle provides granular invalidation. Developer could choose from invalidateProperties(), invalidationSize(), invalidatDisplayList() and invalidateSkinState() (for Spark components). As Flex goes through the lifecycle of “validating” these invalidations, commitProperties(), measure(), updateDisplayList(w, h), getCurrentSkinState() would be called to perform the validation. You may find more information about the component lifecycle here, here, and here.

    In your case, you should not have to invalidate on your own, unless the charting component does not properly invalidate certain property, you don’t need to call the invalidate or validate methods.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I want to construct a data frame in an Rcpp function, but when I

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.