-
Notifications
You must be signed in to change notification settings - Fork 0
/
exampleFillMultiAxis.txt
49 lines (42 loc) · 1.08 KB
/
exampleFillMultiAxis.txt
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
### html ###
<h4>CurvedLines with multi axis and fill</h4>
<div id="flotContainer" class="chart-style"></div>
### css ###
.chart-style {
width: 500px;
height: 300px;
}
### javascript ###
//data
var d1 = [[20,20], [42,60], [54, 20], [80,80]];
var d2 = [[20,700], [80,300]];
//flot options
var options = {
series: {
curvedLines: {active: true}
},
yaxes: [{ min:10, max: 90}, {position: 'right'}]
};
//plotting
$.plot($("#flotContainer"),[
{
data: d1,
lines: { show: true, fill: true, fillColor: "#C3C3C3", lineWidth: 3},
//curve the line (old pre 1.0.0 plotting function)
curvedLines: {
apply: true,
legacyOverride: true // <- use legacy plotting function
}
}, {
data: d1,
points: { show: true }
}, {
data: d2,
yaxis: 2,
lines: { show: true, lineWidth: 3},
}, {
data: d2,
yaxis: 2,
points: { show: true }
}
], options);