My problem was this:
 
    payChart.annotationElements.push(bfl);
 
It doesn't seem to work, but this:
 
    payChart.annotationElements = payChart.annotationElements.concat(bfl);
 
does. Seems a little ott (because I'm guessing this will re-render the other annotationElements on the graph), but it works!


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Tuppeny
Sent: 26 July 2006 10:24
To: [email protected]
Subject: [flexcoders] Adding annotationElements programatically

Hi all,
 
I've got this in my chart, which works:
 
<chart:annotationElements>
      <bestfit:Linear
       dataProvider="{pmService.GetBestFitLines.lastResult.LinearBestFit}"
      />
</chart:annotationElements>
But now I want to do it programatically, so I've removed it, and added this script:
 
var bfl:Quadratic = new Quadratic();
payChart.annotationElements.push(bfl);
bfl.dataProvider = pmService.GetBestFitLines.lastResult.QuadraticBestFit;
// Added to try and force things to update!
payChart.invalidateDisplayList();
payChart.invalidateProperties();
payChart.invalidateSeriesStyles();
 
But the best fit line never appears. I can't provide the source for Quadratic, because there are many base classes, but it's basically a class inheriting from ChartElement which does some drawing in updateDisplayList!
 
Am I doing something wrong?

The information contained in this e-mail and/or any attachments is confidential and intended only for the individual(s) to which it is addressed. If you are not named as an addressee you must not disclose, copy or take any action in reliance of this transmission. This e-mail and its attachments have been scanned for viruses by MessageLabs Ltd.


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

[Inbound Mail Scanned by MessageLabs]

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to