@@ -4,30 +4,41 @@ import { AreaOnlySeries } from "./AreaOnlySeries";
4
4
import { LineSeries } from "./LineSeries" ;
5
5
6
6
interface BollingerSeriesProps {
7
- readonly yAccessor : any ; // func
8
- readonly className ?: string ;
9
7
readonly areaClassName ?: string ;
8
+ readonly className ?: string ;
9
+ readonly fill ?: string ;
10
10
readonly opacity ?: number ;
11
- readonly type ?: string ;
12
- readonly stroke : {
11
+ readonly stroke ?: {
13
12
top : string ,
14
13
middle : string ,
15
14
bottom : string ,
16
15
} ;
17
- readonly fill : string ;
16
+ readonly yAccessor ?: any ; // func
18
17
}
19
18
20
19
export class BollingerSeries extends React . Component < BollingerSeriesProps > {
21
20
22
21
public static defaultProps = {
23
- className : "react-financial-charts-bollinger-band-series" ,
24
22
areaClassName : "react-financial-charts-bollinger-band-series-area" ,
25
- opacity : 0.2 ,
23
+ className : "react-financial-charts-bollinger-band-series" ,
24
+ fill : "#26a69a" ,
25
+ opacity : 0.05 ,
26
+ stroke : {
27
+ top : "#26a69a" ,
28
+ middle : "#812828" ,
29
+ bottom : "#26a69a" ,
30
+ } ,
31
+ yAccessor : ( data : any ) => data . bb ,
26
32
} ;
27
33
28
34
public render ( ) {
29
- const { areaClassName, className, opacity } = this . props ;
30
- const { stroke, fill } = this . props ;
35
+ const {
36
+ areaClassName,
37
+ className,
38
+ opacity,
39
+ stroke = BollingerSeries . defaultProps . stroke ,
40
+ fill,
41
+ } = this . props ;
31
42
32
43
return (
33
44
< g className = { className } >
@@ -47,7 +58,8 @@ export class BollingerSeries extends React.Component<BollingerSeriesProps> {
47
58
className = { areaClassName }
48
59
yAccessor = { this . yAccessorForTop }
49
60
base = { this . yAccessorForScalledBottom }
50
- stroke = "none" fill = { fill }
61
+ stroke = "none"
62
+ fill = { fill }
51
63
opacity = { opacity } />
52
64
</ g >
53
65
) ;
0 commit comments