Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Commit

Permalink
FINISH Real Time Chart
Browse files Browse the repository at this point in the history
  • Loading branch information
leticiaarj committed Mar 27, 2019
1 parent bdd4b70 commit f6cac54
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 164 deletions.
34 changes: 28 additions & 6 deletions unbrake/src/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import Sum from './component/Sum';
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import Reducer from './reducers/index';
import SimpleLineChart from './component/realtimechat'
import RealTimeChart from './component/RealTimeChart'


const data = [

{
Forca:1000, Velocidade: 3000, amt: 3000, //Ponto 1
},
{
Forca:2000, Velocidade: 2000, amt: 200,
},
{
Forca:3000, Velocidade: 1000, amt: 2290,
},
/**{
cd:400, uv: 2780, pv: 3908, amt: 2000, Outros pontos
},
{
name: 'Page E', uv: 1890, pv: 4800, amt: 2181,
},
{
name: 'Page F', uv: 2390, pv: 3800, amt: 2500,
},
{
name: 'Page G', uv: 3490, pv: 4300, amt: 2100,
},*/
];

export default class App extends React.Component {
render() {
return (
<center>
<SimpleLineChart/>
<RealTimeChart data = {data} Y = "Eixo Y" X = "Eixo X" Label1 = "Forca" Label2 = "Velocidade"/>

</center>
);
}
}


5 changes: 0 additions & 5 deletions unbrake/src/actions/index.js

This file was deleted.

32 changes: 32 additions & 0 deletions unbrake/src/component/RealTimeChart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React, { PureComponent } from 'react';
import {
LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend,
} from 'recharts';


export default class RealTimeChart extends React.Component {

render() {
return (

<LineChart
width={600}
height={300}
data={this.props.data}
margin={{
top: 8, right: 5, left: 5, bottom: 5,
}}
>

<CartesianGrid strokeDasharray="2 3" />
<XAxis dataKey="name" label={{ value: this.props.X, position: 'insideBottomRight', offset: -5 }} />
<YAxis label={{ value: this.props.Y, angle: -90, position: 'insideLeft' }}/>
<Tooltip/>
<Legend />
<Line type="monotone" dataKey= {this.props.Label1} stroke="#FF1493" activeDot={{ r: 8 }} />
<Line type="monotone" dataKey= {this.props.Label2} stroke=" #FF8C69" />
</LineChart>

);
}
}
26 changes: 0 additions & 26 deletions unbrake/src/component/Result.js

This file was deleted.

49 changes: 0 additions & 49 deletions unbrake/src/component/Sum.js

This file was deleted.

58 changes: 0 additions & 58 deletions unbrake/src/component/realtimechat.js

This file was deleted.

8 changes: 0 additions & 8 deletions unbrake/src/reducers/index.js

This file was deleted.

12 changes: 0 additions & 12 deletions unbrake/src/reducers/sum.js

This file was deleted.

0 comments on commit f6cac54

Please sign in to comment.