<mx:Application xmlns:mx="/2006/mxml" layout="absolute" width="100%" backgroundColor="white" creationComplete="init();">
<mx:Style>
.font12{font-family:An An;fontSize:15}
.lenchar{
bar-color:red;
}
.mypanelTitle {
color: #66ccff;
fontFamily: Comic Sans MS;
fontWeight: normal;
textDecoration: underline;
}
</mx:Style>
<mx:Script><![CDATA[
import ;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
[Bindable]
private var myAmfurl:String = ""; // Used to connect to external pages
[Bindable]
private var myAmtitle:String = ""; // Used to connect to external pages
[Bindable]
public var testDatas:ArrayCollection=new ArrayCollection();
[Bindable]
private var expenses:ArrayCollection = new ArrayCollection();
[Bindable]
private var arr:Array = new Array();
[Bindable]
private var mintime:Date;
[Bindable]
private var maxtime:Date;
[Bindable]
private var smintime:Date;
[Bindable]
private var emaxtime:Date;
private var timer:Timer;
private var stocksb:Number;
private var dateVar:Date;
private var d: Date = new Date();
private function init():void{
// setInterval(torequest,2000);
myAmfurl = ; //Risk Traceability Link
myAmtitle=;
timer = new Timer(1000);
(, torequest)
();
}
public function torequest(et:Event):void{
setstyle();
();
}
// Used to set style
public function setstyle():void{
}
private function formatDataTip(hitData:HitData):String
{
var s:String = ();
var a:Array = (",");
var str:String=a[3]+":"+a[4];
str += "\n";
str += ;
return str;
}
private function parseDate(value:String):Date{
var a:Array = (",");
var newDate:Date = new Date(a[0],a[1],a[2],a[3],a[4]);
return newDate;
}
private function getResult(e:ResultEvent):void{
var min:String="";
var pattern:RegExp=/,/gi;
for each (var resultXML:XML in ){
var tmpobj:Object=new Object();
=;
=;
=;
stocksb=Number();
var str=;
var a:Array = (",");
mintime= new Date(a[0],a[1],a[2],9,30);
smintime= new Date(a[0],a[1],a[2],11,30);
min=;
maxtime=new Date(a[0],a[1],a[2],15,00);
emaxtime=new Date(a[0],a[1],a[2],13,00);
if(==0){
(tmpobj);
}else{
var check:int=0;
if(>0){
for each(var subtempobj:Object in expenses){
if(String().replace(pattern,"")==String().replace(pattern,"")){
check=1;
}
}
}
if(check==0){
(tmpobj);
check=0;
}
}
}
var tmpobj1:Object=new Object();
var tmpobj2:Object=new Object();
var a:Array = (",");
=stocksb;
=a[0]+","+a[1]+","+a[2]+","+"9,30";
=stocksb;
=a[0]+","+a[1]+","+a[2]+","+"15,00";
(tmpobj1);
(tmpobj2);
}
private function mylabel(labelValue:Object, previousValue:Object, d:IAxis):String {
var temp:String="";
var currvalue:Number = Number(());
if(currvalue>stocksb){
temp = '<font color="#ff0000" size="11">'+()+'</font>';
}else{
temp = '<font color="#48ff00" size="11">'+()+'</font>';
}
return temp;
}
]]></mx:Script>
<!-- Define custom Strokes. -->
<mx:Stroke id = "s1" color="#FFFFFF" weight="0.1"/>
<mx:Stroke id = "s2" color="#F1F1B8" weight="1"/>
<mx:Stroke id = "s3" color="green" weight="1"/>
<mx:Stroke color="red" weight="1" alpha="0.6"/>
<mx:HTTPService result="getResult(event);" url="{myAmfurl}" useProxy="false" resultFormat="e4x" method="POST">
</mx:HTTPService>
<mx:Panel title="{myAmtitle}" fontSize="15" height="100%" width="100%" color="red" backgroundColor="#000000" borderStyle="inset">
<mx:LineChart styleName="lenchar" dataTipFunction="formatDataTip" showDataTips="true" height="100%" width="100%" fontFamily="Song style" fontSize="12">
<mx:backgroundElements>
<mx:GridLines direction="both">
<mx:horizontalStroke>
<mx:Stroke color="red" weight="1" alpha="0.6"/>
</mx:horizontalStroke>
<mx:verticalStroke>
<mx:Stroke color="red" weight="1" alpha="0.2"/>
</mx:verticalStroke>
</mx:GridLines>
</mx:backgroundElements >
<!-- vertical axis -->
<mx:verticalAxis>
<mx:LinearAxis baseAtZero="false" title="" labelFunction="mylabel"/>
</mx:verticalAxis>
<mx:horizontalAxis>
<!--mx:CategoryAxis categoryField="date" displayName="date" title="date" /-->
<!--mx:LinearAxis displayName="date" minimum="1" interval="10"/ -->
<!--<mx:DateTimeAxis dataUnits="seconds" interval="30" minimum="{minDate}" maximum="{maxDate}"/>-->
<!--<mx:DateTimeAxis parseFunction="parseDate" interval="1" minimum="{mintime}" maximum="{maxtime}" displayLocalTime="true" dataInterval="1" dataUnits="hours" labelUnits="hours" />-->
<mx:DateTimeAxis
disabledDays="{[0,6]}"
disabledRanges="{[{rangeStart:smintime, rangeEnd:emaxtime}]}"
parseFunction="parseDate" interval="1" minimum="{mintime}" maximum="{maxtime}" displayLocalTime="true" dataInterval="30" dataUnits="minutes" labelUnits="minutes"
/>
</mx:horizontalAxis>
<!-- horizontal axis renderer -->
<mx:horizontalAxisRenderers>
<mx:AxisRenderer axis="{hAxis}" canDropLabels="true" axisStroke="{vstroke}" />
</mx:horizontalAxisRenderers>
<mx:verticalAxisRenderers>
<mx:AxisRenderer axis="{va}" canDropLabels="true" axisStroke="{vstroke}" />
</mx:verticalAxisRenderers>
<!-- series -->
<mx:series>
<mx:LineSeries yField="value" xField="date" displayName="value" dataProvider="{}" lineStroke="{s1}" />
<mx:LineSeries yField="value" xField="date" displayName="TestData" dataProvider="{}" lineStroke="{s2}" />
</mx:series>
</mx:LineChart>
</mx:Panel>
</mx:Application>