Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-25-2008, 10:38 PM   #1
kminev
Senior Member
 
Join Date: Jun 2008
Posts: 129
Default Chart item fill function

I need to exclude all the data point that have zero and not plot them. Can I do that in my fill function maybe exit the function????

Here is my fill function:

Code:
private function myFillFunction(element:ChartItem, index:Number):IFill {
        	
        	var item:PlotSeriesItem = PlotSeriesItem(element);
        	var hitObj:HitData = new HitData(0, 0, item.x, item.y, element);
        	
        	/*
        	switch(hitObj.item.A)
        	{
        		case "Add":
        			return green;
        		case "Delete":
        			return red;
        		case "Change":
        			return yellow;
        		default:
        			return null;	       		
        	}
        	*/
        	
        	if(wtog.selected == true)
        	{
        		trace("ACTION: " + hitObj.item.A + " W2G: " + hitObj.item.W2G);
        		switch(hitObj.item.A)
        		{
        		case "Add":
        			if(hitObj.item.W2G > 0)
        			{
        				return green;
        			}
        			else
        			{
        				return null;
        			}
        		case "Delete":
        		if(hitObj.item.W2G > 0)
        			{
        			return red;
        			}
        			else
        			{
        				return null;
        			}
        		case "Change":
        		if(hitObj.item.W2G > 0)
        			{
        			return yellow;
        			}
        			else
        			{
        				return null;
        			}
        		default:
        			return null;	       		
        		}
        	
        	}

Thanks in advnace
kminev is offline   Reply With Quote
Old 08-26-2008, 11:08 AM   #2
rawmantick
Pipty rupees only!
 
rawmantick's Avatar
 
Join Date: Jul 2007
Location: Germany
Posts: 1,730
Default

Yeh, you can return from function. Or simply like
ActionScript Code:
if( point i dont like and dont want to draw )              return null;
Or did not I understood the problem?
__________________
Bang!
rawmantick is offline   Reply With Quote
Old 08-26-2008, 04:07 PM   #3
kminev
Senior Member
 
Join Date: Jun 2008
Posts: 129
Default

Yes, but once I return null if I don't like the statement than it uses the default color and still plots my data points.
kminev is offline   Reply With Quote
Old 08-26-2008, 05:48 PM   #4
rawmantick
Pipty rupees only!
 
rawmantick's Avatar
 
Join Date: Jul 2007
Location: Germany
Posts: 1,730
Default

Then read about IFill interface... You can implement it easily, leaving it's drawing functions empty.
__________________
Bang!
rawmantick is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Video Smoothing agent-vip ActionScript 2.0 0 05-08-2007 12:21 AM
My life's a script Actualman ActionScript 2.0 2 12-15-2005 06:38 PM
Database simulated with arrays on a cd-rom lecasn5 Components 61 09-07-2004 11:40 AM
I can't resart my streaming sounds after they've been paused! athomas ActionScript 1.0 (and below) 2 07-01-2004 03:18 PM
enterframe and load and objects, oh my! dice ActionScript 1.0 (and below) 13 07-18-2003 11:07 AM


All times are GMT. The time now is 09:29 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.