johncblandii Report post Posted February 5, 2008 We wanted to show our lines behind the graph(s) but they always showed up on top. So, here are the steps I took to allow for depth management (MSArea2dChart.as). 1) In the chart attribute parsing function add a new param for vDivLineDepth (or whatever you want to call it). I set the available values to TOP and BOTTOM. 2) Create a holder variable (MovieClip). I called it vDivLineHolder. 3) In drawVDivLines, add the following code: vDivLineHolder = this.cMC.createEmptyMovieClip("vDivLineHolder", this.dm.getDepth("VDIVLINES")); vDivLineHolder._x = this.elements.canvas.x + this.params.canvasPadding; vDivLineHolder._y = this.elements.canvas.y; if (this.params.vDivLineDepth.toUpperCase() == "BOTTOM") { vDivLineHolder.swapDepths(this.dm.getDepth("DIVLINES")+1); }else { vDivLineHolder.swapDepths(this.lgndMC); } This is nothing but a bit of a "hack" to get it to work right. The concept is to add all lines to 1 single parent movieclip vs adding them 1 by 1 to the canvas. There are some other changes that need to be made though. 4) You're going to need to toy with the positioning of the elements. My present source code has numerous other changes so to not confuse I'll leave it as just a notice. Keep in mind you're taking a global x/y value and applying it inside a clip that will start N pixels from the left...just do simple math on it. 5) The last step is in the allotDepths function. Add +1 to the DIVLINES allotment. This way you can swap with that depth (as soon on line 6) which will be empty so you're essentially swapping with nothing. Line 8 shows you swapping with the legend. It is always going to be on the top of the background anyway so there is no worries of it being too high or too low. Again, this isn't the absolute best solution but without rewriting a lot of the code this was the best way to meet our needs. So, to bring this back as a suggestion/request...Fusion, please allow us to control whether the div lines are on top of the graph(s) or behind them. Thanks. Share this post Link to post Share on other sites
Pallav Report post Posted February 13, 2008 Hi, If you want to change the depth in code, you can just alter the same in allotDepth() method of the chart class and it'll reflect on the chart. Share this post Link to post Share on other sites