Hi Ely, thank you for your detailed answer and the code examples. This was not exactly what I am looking for but gave me the hints to solve my problem. The key is that your backgroundElement extends ChartingElement. But now I have got the problem that the backgroundElement is in front of the PlotChart lines. How can I swap them? Again thanks a lot, Sönke
_____ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ely Greenfield Sent: Monday, November 20, 2006 7:15 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Flex 2 Charting dynamic backgroundElements Hi Sonke (sorry, can't figure out how to type an umlaud (sp?) on an American keyboard ): It sounds like your problem is a prime candidate for a custom background element. If your shapes depend on the min max of the axes, that probably means you want to annotate/illustrate a particular data value/range, yes? Any time you're trying to draw data values, you should really be creating a chart element (that's pretty much what they're there for). That means a series, a backgroundElement, or an annotationElement. I've attached a simple example of a custom background element that takes a series of data values and draws matching bands in the background. It should give you a starting point for what you're trying to do. Ely. _____ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sönke Rohde Sent: Sunday, November 19, 2006 6:43 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Flex 2 Charting dynamic backgroundElements Hi, I have to draw shapes and lines into the background of a Plotchart. The size/position of the shapes and lines depends on the minimum and maximum of the horizontal and vertical linear axis. My first try was to use the backgroundElements to solve this problem. I created a shape, drawed a polygon on it and added it to the backgroundElements: var shape:Shape = new Shape(); var gr:Graphics = shape.graphics; gr.moveTo(0, 20); gr.beginFill(0xFF9900, 50); gr.lineTo(0, 0); gr.lineTo(100, 0); gr.lineTo(100, 100); gr.lineTo(0, 20); gr.endFill(); backgroundElements.reverse(); backgroundElements.push( shape ); I reversed the array to keep the GridLines in the front. The polygon is visible in the background but it is scaled to fit the size of the PlotChart. The shape has to keep its scaling. How do I know the width/height of the PlotChart content area? With this information and the min/max of the x/y axis I am able to do the drawing. Any hint is very appreciated. Cheers, Sönke