ChartPressure.js 1.14 KB
Newer Older
Spark's avatar
chartjs    
Spark committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import React from 'react'
import { Row, Col } from 'react-bootstrap';
import { Bar, Line } from 'react-chartjs-2'

function ChartPressure() {

    const options = {
        legend: {
            display: true, // label 보이기 여부
        },
        scales: {
            yAxes: [{
                display: true,
                ticks: {
                    min: 900,
                    max: 1100,
                    stepSize: 20
                }
            }]
        },
Spark's avatar
Spark committed
21
        maintainAspectRatio: false
Spark's avatar
chartjs    
Spark committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    }
    const data = {
        labels: ['1', '2', '3', '4', '5', '6', '77', '88', '99'],
        datasets: [
            {
                label: '기압',
                data: [1008, 1007, 1000, 1010, 1080, 1020, 1025, 1080, 1030],
                borderWidth: '2',
                fill: true,
                borderColor: 'rgba(75,192,192)',
                backgroundColor: 'rgba(75,192,192,0.4)',
                tension: 0.3
            }
        ]
    };

    return (
        <Col id='chartTab'>
            <Line
                data={data}
Spark's avatar
Spark committed
42
                options={options}
Spark's avatar
chartjs    
Spark committed
43
44
45
46
47
48
            />
        </Col>
    )
};

export default ChartPressure;