Find Dynamicaly set min and max values for chart Axis

Set Dynamicaly min and max values in flex using loops

[Bindable]

private var firstAxisMin:int=0;

[Bindable]

private var firstAxisMax:int=0;

[Bindable]

private var firstTmp:int=0;

[Bindable]

private var firstTmp1:int=0;

[Bindable]

private var secondAxisMin:int=0;

[Bindable]

private var secondAxisMax:int=0;

[Bindable]

private var secondTmp:int=0;

[Bindable]

private var secondTmp1:int=0;

[Bindable]

private var firstAxis:Array = new Array();

[Bindable]

private var secondAxis:Array = new Array();

firstAxis = [“activesub”,”week”];

for(var i:int = 0 ;i<arrDatabases.length;i++)

{

for(var j:int = 0 ;j arrDatabases[i][firstAxis[j]])

{

firstAxisMin = arrDatabases[i][firstAxis[j]];

firstTmp = firstAxisMin;

}

else if(firstAxisMax < arrDatabases[i][firstAxis[j]])

{

firstAxisMax = arrDatabases[i][firstAxis[j]];

firstTmp1 = firstAxisMax;

}

}

}

firstAxisMax = ((firstAxisMax*1.5)+firstTmp1);

Using Database Query and Flex

[Bindable]

public var tmpQueryMax:String = “select max(abs(cm)) as cm,max(abs(sr)) as sr from quadrant “;

[Bindable]

public var arrDatabasesMax:ArrayCollection = new ArrayCollection();

private function QuadrantMaxResultHandler(event:ResultEvent):void

{

arrDatabasesMax = event.result as ArrayCollection;

var cm:Number = arrDatabasesMax[0][‘cm’];

var sr:Number = arrDatabasesMax[0][‘sr’];

if(cm<sr)

firstAxisMax = sr+1;

else

firstAxisMax = cm+1;

firstAxisMin = -firstAxisMax;

//Alert.show(" "+ firstAxisMax+" "+firstAxisMin);

}

About ashokabhat

I am a C,C ,JAVA,Adobe Flex,.NET Programmer Currently working as a Software Developer
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s