-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathAreaChart.jsx
More file actions
43 lines (37 loc) · 948 Bytes
/
AreaChart.jsx
File metadata and controls
43 lines (37 loc) · 948 Bytes
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
import d3 from 'd3';
import { PropTypes } from 'react';
import D3ReactBase from '../charts/D3ReactBase';
import AreaChartImpls from './AreaChartImpls';
import './style.scss';
export default class AreaChart extends D3ReactBase {
static propTypes = {...D3ReactBase.propTypes,
fillColor: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
fillOpacity: PropTypes.number,
interpolate: PropTypes.string
};
static defaultProps = {...D3ReactBase.defaultProps,
xScale: d3.scale.ordinal(),
className: 'area-chart',
interpolate: 'basis',
xaxis: {
className: 'x axis',
orient: 'bottom',
position: 'bottom',
attr: {
dx: '0',
dy: '0.5em'
},
style: {
'text-anchor': 'middle'
}
},
yaxis: {
className: 'y axis',
orient: 'left',
}
};
constructor (props) {
super(props);
this.chartConstructor = AreaChartImpls;
}
}