/
RecordsPerSecondChartView.mxml
134 lines (115 loc) · 5.22 KB
/
RecordsPerSecondChartView.mxml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2007 James Ward
http://www.jamesward.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-->
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:charts="com.jamesward.census2.charts.*"
verticalScrollPolicy="off" horizontalScrollPolicy="off" xmlns:controls="com.jamesward.census2.controls.*">
<mx:Script>
import com.jamesward.census2.controls.ChartDataPopUp;
import com.jamesward.census2.utils.TextFormatters;
import mx.core.Application;
import mx.charts.ChartItem;
import mx.charts.events.ChartItemEvent;
</mx:Script>
<mx:ArrayCollection id="dataProvider"/>
<mx:SeriesInterpolate id="interpolate"/>
<mx:BarChart id="chart" width="100%" height="100%" dataProvider="{dataProvider}"
showDataTips="false" type="stacked" verticalAxisRatio="1" selectionMode="multiple"
gutterRight="20">
<mx:updateComplete>
Application.application.cdp.height = chart.height - chart.computedGutters.height - 2;
</mx:updateComplete>
<mx:change>
var c:ChartItem = chart.selectedChartItem;
if (c != null)
{
for each (var s:BarSeries in chart.series)
{
s.selectedIndex = c.index;
}
}
Application.application.selectChartItem(c);
</mx:change>
<mx:backgroundElements>
<charts:ChartBackgroundFill/>
</mx:backgroundElements>
<mx:verticalAxis>
<mx:CategoryAxis id="lrtcVA" categoryField="name"/>
</mx:verticalAxis>
<mx:verticalAxisRenderers>
<charts:StyledAxisRenderer axis="{lrtcVA}"/>
</mx:verticalAxisRenderers>
<mx:horizontalAxis>
<mx:LinearAxis id="lrtcHA" labelFunction="TextFormatters.timeFormat"/>
</mx:horizontalAxis>
<mx:horizontalAxisRenderers>
<charts:StyledAxisRenderer axis="{lrtcHA}"/>
</mx:horizontalAxisRenderers>
<mx:series>
<mx:BarSeries id="totalServerTimeSeries" xField="totalServerTime" showDataEffect="{interpolate}" displayName="Server Exec Time" itemRenderer="com.jamesward.census2.charts.BarItemRenderer"
selectable="true" useHandCursor="true" mouseChildren="false" buttonMode="true">
<mx:fill>
<mx:LinearGradient angle="90">
<mx:entries>
<mx:Array>
<mx:GradientEntry color="#e28741" ratio="0" alpha="100"/>
<mx:GradientEntry color="#c6691c" ratio="1" alpha="100"/>
</mx:Array>
</mx:entries>
</mx:LinearGradient>
</mx:fill>
</mx:BarSeries>
<mx:BarSeries xField="transferTime" showDataEffect="{interpolate}" displayName="Transfer Time" itemRenderer="com.jamesward.census2.charts.BarItemRenderer"
selectable="true" useHandCursor="true" mouseChildren="false" buttonMode="true" currentState="{totalServerTimeSeries.currentState}">
<mx:fill>
<mx:LinearGradient angle="90">
<mx:entries>
<mx:Array>
<mx:GradientEntry color="#467299" ratio="0" alpha="100"/>
<mx:GradientEntry color="#2a547a" ratio="1" alpha="100"/>
</mx:Array>
</mx:entries>
</mx:LinearGradient>
</mx:fill>
</mx:BarSeries>
<mx:BarSeries xField="parseTime" showDataEffect="{interpolate}" displayName="Parse Time" itemRenderer="com.jamesward.census2.charts.BarItemRenderer"
selectable="true" useHandCursor="true" mouseChildren="false" buttonMode="true" currentState="{totalServerTimeSeries.currentState}">
<mx:fill>
<mx:LinearGradient angle="90">
<mx:entries>
<mx:Array>
<mx:GradientEntry color="#f6c54c" ratio="0" alpha="100"/>
<mx:GradientEntry color="#d8a62d" ratio="1" alpha="100"/>
</mx:Array>
</mx:entries>
</mx:LinearGradient>
</mx:fill>
</mx:BarSeries>
<mx:BarSeries xField="renderTime" showDataEffect="{interpolate}" displayName="Render Time" itemRenderer="com.jamesward.census2.charts.BarItemRenderer"
selectable="true" useHandCursor="true" mouseChildren="false" buttonMode="true" currentState="{totalServerTimeSeries.currentState}">
<mx:fill>
<mx:LinearGradient angle="90">
<mx:entries>
<mx:Array>
<mx:GradientEntry color="#ff3f20" ratio="0" alpha="100"/>
<mx:GradientEntry color="#c92719" ratio="1" alpha="100"/>
</mx:Array>
</mx:entries>
</mx:LinearGradient>
</mx:fill>
</mx:BarSeries>
</mx:series>
</mx:BarChart>
</mx:Canvas>