-
-
Notifications
You must be signed in to change notification settings - Fork 153
/
Copy pathNegHorzLine.ux
64 lines (54 loc) · 1.93 KB
/
NegHorzLine.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
<ChartPage Title="Negative values with in-plot ticks" File="NegHorzLine" ux:Class="NegHorzLine" xmlns:c="Fuse.Charting">
<JavaScript>
var Observable = require("FuseJS/Observable")
exports.pointsA = Observable( -10, -50,-20, -30, -35 )
exports.pointsB = Observable( -5, -40,-30, -20, -45 )
function randomItems() {
var items = []
for (var i =0; i < 5; ++i) {
items.push( -Math.random() * 50 )
}
return items
}
exports.random = function() {
exports.pointsA.replaceAll( randomItems() )
exports.pointsB.replaceAll( randomItems() )
}
</JavaScript>
<AttractorConfig Unit="Normalized" Easing="CubicInOut" Duration="0.3" ux:Global="plotAttract"/>
<c:Plot XAxisMetric="Count" RangePadding="0.1">
<c:DataSeries Data="{pointsA}"/>
<c:DataSeries Data="{pointsB}"/>
<ChartButton Alignment="TopRight" Margin="5" Clicked="{random}" Label="✧"/>
<Panel ux:Name="thePlot">
<c:PlotData SeriesIndex="0" SkipEnds="1">
<c:PlotPoint Width="5%" Height="5%" Attractor="plotAttract">
<RegularPolygon Sides="3" Color="#338"/>
</c:PlotPoint>
</c:PlotData>
<Curve StrokeWidth="2" StrokeColor="#77A">
<c:PlotData SeriesIndex="0">
<c:PlotCurvePoint Attractor="plotAttract"/>
</c:PlotData>
</Curve>
</Panel>
<Panel>
<c:PlotData SeriesIndex="1" SkipEnds="1">
<c:PlotPoint Width="5%" Height="5%" Attractor="plotAttract">
<RegularPolygon Sides="5" Color="#383"/>
</c:PlotPoint>
</c:PlotData>
<Curve StrokeWidth="2" StrokeColor="#7A7">
<c:PlotData SeriesIndex="1">
<c:PlotCurvePoint Attractor="plotAttract"/>
</c:PlotData>
</Curve>
</Panel>
<c:PlotTicks Axis="Y" StrokeWidth="1" StrokeColor="#8888"/>
<c:PlotAxis Axis="Y" ContentPosition="Anchor" SkipEnds="1,0">
<Text ux:Template="Label" Alignment="TopCenter"
FontSize="height(thePlot) * 0.05" Color="#AAA"
Value="{Plot axis.value}" Margin="5"/>
</c:PlotAxis>
</c:Plot>
</ChartPage>