forked from alibaba/rax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Line.js
44 lines (40 loc) · 1.09 KB
/
Line.js
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
import {createElement, Component, render} from 'rax';
import Chart, {Line, Coord, Axis} from 'rax-charts';
class LineDemo extends Component {
render() {
const lineData = [
{time: '2016-08-08 00:00:00', tem: 10},
{time: '2016-08-08 00:10:00', tem: 22},
{time: '2016-08-08 00:30:00', tem: 20},
{time: '2016-08-09 00:35:00', tem: 26},
{time: '2016-08-09 01:00:00', tem: 20},
{time: '2016-08-09 01:20:00', tem: 26},
{time: '2016-08-10 01:40:00', tem: 28},
{time: '2016-08-10 02:00:00', tem: 20},
{time: '2016-08-10 02:20:00', tem: 28}
];
const lineConfig = {
time: {
type: 'timeCat',
mask: 'mm/dd',
tickCount: 3,
range: [0, 1]
},
tem: {
tickCount: 5,
min: 0
}
};
return <Chart style={{
width: 750,
height: 350
}} data={lineData} config={lineConfig}>
<Axis name="time" />
<Axis name="tem" label={{
fontSize: 14
}} />
<Line position="time*tem" inner={0.3} shape="smooth" />
</Chart>;
}
}
export default LineDemo;