removed limit of 500 elements, fixed margins

This commit is contained in:
Giulio De Pasquale 2020-12-18 18:59:43 +00:00
parent 76243d8b7f
commit 361bf0fd2a

View File

@ -55,13 +55,6 @@ class RPlot extends Component<{}, PlotState> {
}) })
socket.on("new_tick", (data: NewTickMessage) => { socket.on("new_tick", (data: NewTickMessage) => {
const new_x = [...this.state.x, data.tick];
const new_y = [...this.state.y, data.price];
// cutting to up to 500 entries (last 500)
const x = new_x.slice(Math.max(new_x.length - 500, 0));
const y = new_y.slice(Math.max(new_y.length - 500, 0));
const position_price_lines = data.positions.map((pstat): PriceLine => { const position_price_lines = data.positions.map((pstat): PriceLine => {
return { return {
x0: 0, x0: 0,
@ -117,10 +110,10 @@ class RPlot extends Component<{}, PlotState> {
]} ]}
layout={{ layout={{
margin: { margin: {
l: 50, l: 110,
r: 50, r: 20,
b: 50, b: 100,
t: 50, t: 20,
pad: 4 pad: 4
}, },
dragmode: "pan", dragmode: "pan",
@ -165,7 +158,7 @@ class RPlot extends Component<{}, PlotState> {
displayModeBar: false, displayModeBar: false,
responsive: true, responsive: true,
}} }}
style={{width: '100%', height: '90%'}} style={{width: '100%', height: '100%'}}
/> />
) )
} }