johncblandii

Members
  • Content count

    6
  • Joined

  • Last visited

About johncblandii

  • Rank
    Forum Newbie
  1. I'm making numerous tweaks to the charts and I have the MSArea2DChart doing what we need but now we need the MSLine2DChart to do it too. I'm going over code and things like drawing labels, vdivlines, etc looks to be line for line exact. So, my request is to better modularize common functionality into utility classes or just put them in a common parent class. This way if people buy the source, like we did, someone poor soul, like me, doesn't have to make changes to every chart source file to fix the staggering logic. :-( Thanks.
  2. When can I get FC in ActionScript 3.0

    That's not good. The last time I heard it was 1st quarter '08.
  3. 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.
  4. BUG: MSArea2D, labelDisplay="STAGGER", staggerLines=2

    Ok, will do. I'll create a new post just explaining how to manage vertical line depths (at least one approach to it). If anyone has wants to see the code for the fix above I'll post it l8rz (it is on my other laptop). Thanks!
  5. BUG: MSArea2D, labelDisplay="STAGGER", staggerLines=2

    Actually, I already implemented the fix so I can't validate whether this xml would fail or not. If you can just create XML to generates 288 categories with labelStep 12 and 2 data series to match, you should see it reproduced. This was in the MSArea2DChart.as. I have an enhancement I can post regarding vertical lines. Should I post code in the forums or not? I wouldn't have to post everything but 1 function and a couple notes within other functions. Let me know. Thanks.
  6. The problem is in the loop. On line 1610 you are looping over every single category in the list and skipping them if showLabel == false. That's fine but the math used in the loop is i%#. For our present dataset i% any of our numbers will ALWAYS be 1. Here is the trace using your original math: (excuse formatting) i label pos staggerLines 1 12AM 0 16 13 1AM 0 16 25 2AM 0 16 37 3AM 0 16 49 4AM 0 16 61 5AM 0 16 73 6AM 0 16 85 7AM 0 16 97 8AM 0 16 109 9AM 0 16 121 10AM 0 16 133 11AM 0 16 145 12PM 0 16 157 1PM 0 16 169 2PM 0 16 181 3PM 0 16 193 4PM 0 16 205 5PM 0 16 So, do you see how i%2 (the number of staggerLines we're using) will always fail? Ok...now to fix it. Create a counter variable (var counter:Number = 1; roughly around line 1609) and inside the first if statement (in the for loop) increment counter; right after or before depth++). Now, in the else if labelDisplay == "STAGGER" change all references to "i" to counter EXCEPT when referencing the this.categories. There are really just two places. I would upload the file but I'm not 100% sure if Fusion would like me throwing up source code to the general public. :-) Fusion, if you want my class changes I'll send'em to you. Just ping me. I hope this helps someone. Just know in the latest v3, as of today, the STAGGER code is buggy so don't be surprised if you find your chart not properly rendering the labels in stagger mode. Again, this depends on your dataset/numbers. It could be that they line up properly. Thanks.