Adobe Dreamweaver Forums



Last 10 THreads :         DW8 Activation not working (Last Post : moonliner - Replies : 0 - Views : 1 )           »          Creating a boundry in the stage... (Last Post : Rob Dillon - Replies : 1 - Views : 2 )           »          Re: Mouse capture won't activate (Last Post : robertnagle - Replies : 0 - Views : 1 )           »          help! my FB3 has gone insane! (Last Post : peteandrus - Replies : 0 - Views : 1 )           »          help! my FB3 has gone insane! (Last Post : peteandrus - Replies : 0 - Views : 1 )           »          How come the html is being displayed, and not the link (Last Post : Skaterstu - Replies : 0 - Views : 1 )           »          Another way to accomplish this (Last Post : Andy-K - Replies : 2 - Views : 3 )           »          HELP! Cannot upload files in DW CS4 (Last Post : dan@hoppernet.org - Replies : 6 - Views : 7 )           »          Adobe Flash 10 kills Wimpy (Last Post : m77ty8uu - Replies : 32 - Views : 208 )           »          How do I unlock all files in site at once (Last Post : Alan - Replies : 1 - Views : 2 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 10-08-2008, 05:12 PM
bradwood.com
 
Posts: n/a
Diggs:
Default Can Line Chart charts base renderer by category

I have done some Googling on this, but frankly I'm not sure what to even search
for. Here is what my boss wants:

A month by month chart of sales showing revenue trends as well as projections
for then next two months. He wants a solid line for actual data in existing
months which turns into a dotted line with projection data for future months.

I have downloaded and played with the code from quietly scheming
(http://www.quietlyscheming.com/blog/.../dashed-lines/) but it seems to
apply to the entire line.

I'm not sure if the direction I should be taking is two different line renders
based on the category axis, or a way to make the renderer smart enough to
change the line at the appropriate time.

Thoughts please?

Thanks.



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-08-2008, 06:43 PM
bradwood.com
 
Posts: n/a
Diggs:
Default Re: Can Line Chart charts base renderer by category

Oh, a 3rd option I'm not sure about is if I could have an extra series for the
projection that would only have data during the future months. I'm not sure if
I can create a series that only has data for certain months though.

Reply With Quote
  #3 (permalink)  
Old 10-09-2008, 05:43 AM
ice9_us
 
Posts: n/a
Diggs:
Default Re: Can Line Chart charts base renderer by category

how do you keep your data?
are you running the projections based on numbers you have? Then
doing the calculations on the client side with flex and actionscript?
When i do stuff like that..
I do it on the server side.. then send it to my PC for display...
I do some number crunching.. but I do all the data crunching when the usr hits
the url...
Then i send it as XML for display.. less work for me.. and server side is far
faster for stuff like that than the users computer...

Reply With Quote


  #4 (permalink)  
Old 10-09-2008, 05:25 PM
bradwood.com
 
Posts: n/a
Diggs:
Default Re: Can Line Chart charts base renderer by category

In this instance it can be assumed that a ColdFusion web service will be handing back all the data necessary to display the graph via a remote object call.
Reply With Quote
  #5 (permalink)  
Old 10-13-2008, 09:41 PM
bradwood.com
 
Posts: n/a
Diggs:
Default Re: Can Line Chart charts base renderer by category

I'm still playing with this solution, but for what it's worth this is what I am
doing:

I downloaded the source from quietly scheming for the dashed line renderer.
(http://www.quietlyscheming.com/blog/.../dashed-lines/)

I changed the DashedLineSeries to a ProjectionLineSeries and changed the
DashedLineRenderer to be ProjectionLineRenderer. Then in the renderer, I
changed the updateDisplayList method to loop over the LineSeriesItems
(_lineSegment.items array) and find where past meets future. Note: in doing
this, I made an assumption that your xValue would be a date to use this series.
I then used a combination of the drawPolyLine and drawDashedPolyLine methods
from their respective graphics utility classes to draw the applicable portions
of the line.

Here is the contents of the ProjectionLineRenderer.updateDisplayList method as
I have it now.

override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void
{
var stroke:IStroke = getStyle("lineStroke");
var form:String = getStyle("form");
var pattern:Array = getStyle("dashingPattern");
pattern = (pattern == null) ? _pattern : pattern;

graphics.clear();

var current_dateate = new Date();
var beginning_of_monthate = new
Date(current_date.getMonth(),1,current_date.getFul lYear());
var projected_items:Array = new Array();

// Loop over the lineseriesitems
for(var i:int = 1;i<_lineSegment.items.length;i++)
{
// Grab the items whose dates are in the future
if(LineSeriesItem(_lineSegment.items[i]).xValue = beginning_of_month)
{
// If this is the first item that is in the future, back
// up and grab the previous one so our dotted has a starting point
if(projected_items.length == 0 && i > 0)
{
projected_items.push(_lineSegment.items[i-1]);
}
// Add the future data points into the projected array
projected_items.push(_lineSegment.items[i]);
}
}


// Draw the solid portion of the line. Notice the end point is the size of
the entire array, minus the future points.
// Adjusted by two because they overlap one point and the array starts at 0.

GraphicsUtilities.drawPolyLine(graphics,_lineSegme nt.items,_lineSegment.start
,_lineSegment.end,"x","y",stroke,form);
// Draw the dashed portion with the projected_items array
DashedGraphicUtilities.drawDashedPolyLine(graphics , stroke, pattern,
projected_items);

}

Technically, I am also assuming that the last data point is the current month,
and therefore the projected one. Based on that, the date math is probably
unnecessary, but maybe I'll change that later.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 02:25 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk