-
-
Notifications
You must be signed in to change notification settings - Fork 153
/
Copy pathGroupLine.ux
65 lines (55 loc) · 2.04 KB
/
GroupLine.ux
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
<ChartPage ux:Class="GroupLine" File="GroupLine" Title="Lots of data in groups" xmlns:c="Fuse.Charting">
<JavaScript>
var Observable = require("FuseJS/Observable")
exports.items = Observable()
for (var i=0; i < 500; ++i) {
exports.items.add( Math.sin(i / 20.0) * Math.cos(i/40) )
}
//the very small step values are to show the offseting/scrolling of groups in detail
exports.incrOffset = function() {
plot.stepOffset(1)
}
exports.decrOffset = function() {
plot.stepOffset(-1)
}
</JavaScript>
<c:Plot Margin="20,10,50,10" ux:Name="plot"
DataExtend="20,20"
YAxisSteps="2" YRange="-1,1">
<c:DataSeries Data="{items}"/>
<GridLayout Columns="20,10,1*" Rows="1*,10,20"/>
<c:PlotAxis Row="0" Column="0" Axis="Y">
<Text ux:Template="Label" Alignment="CenterRight"
Value="{Plot axis.value}" FontSize="12" Color="#000"/>
</c:PlotAxis>
<c:PlotTicks Axis="Y" StrokeWidth="1" StrokeColor="#000" AxisLine="1"/>
<Panel ClipToBounds="true">
<c:PlotArea XStepSize="5"/>
<c:PlotTicks StrokeWidth="1" StrokeColor="#0048" Group="20"/>
<Curve StrokeWidth="3" StrokeColor="#000">
<c:PlotData>
<c:PlotCurvePoint/>
</c:PlotData>
</Curve>
</Panel>
<c:PlotTicks Row="1" Column="2" StrokeWidth="1" StrokeColor="#000" AxisLine="0"
Group="5"/>
<c:PlotAxis Row="2" Column="2" Axis="X" HitTestMode="None" Group="20" ClipToBounds="true"
ExcludeExtend="false">
<Text ux:Template="Label" TextAlignment="Center" FontSize="20" Color="#000"
Value="{Plot axis.value}" Background="#EEE" Margin="2,0"/>
</c:PlotAxis>
<Panel Row="1" RowSpan="2" Column="2">
<WhileTrue Value="{Plot hasNext}">
<Panel Layer="Overlay" Alignment="BottomRight" Anchor="0%,100%">
<ChartButton Label="▶" Clicked="{incrOffset}" Padding="2,0"/>
</Panel>
</WhileTrue>
<WhileTrue Value="{Plot hasPrev}">
<Panel Layer="Overlay" Alignment="BottomLeft" Anchor="100%,100%">
<ChartButton Label="◀" Clicked="{decrOffset}" Padding="2,0"/>
</Panel>
</WhileTrue>
</Panel>
</c:Plot>
</ChartPage>