h_price_line to current_price_line
This commit is contained in:
parent
dfdb2e46a9
commit
9ae8389f83
@ -20,14 +20,14 @@ type PriceLine = {
|
||||
type PlotState = {
|
||||
x: Array<number>,
|
||||
y: Array<number>,
|
||||
h_price_line: PriceLine,
|
||||
current_price_line: PriceLine,
|
||||
}
|
||||
|
||||
class RPlot extends Component<{}, PlotState> {
|
||||
state = {
|
||||
x: [],
|
||||
y: [],
|
||||
h_price_line: {x0: 0, x1: 0, y0: 0, y1: 0},
|
||||
current_price_line: {x0: 0, x1: 0, y0: 0, y1: 0},
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
@ -42,7 +42,7 @@ class RPlot extends Component<{}, PlotState> {
|
||||
this.setState({
|
||||
x: data.ticks,
|
||||
y: data.prices,
|
||||
h_price_line: {
|
||||
current_price_line: {
|
||||
x0: 0,
|
||||
y0: last_price,
|
||||
x1: last_tick,
|
||||
@ -62,7 +62,7 @@ class RPlot extends Component<{}, PlotState> {
|
||||
this.setState({
|
||||
x: x,
|
||||
y: y,
|
||||
h_price_line: {
|
||||
current_price_line: {
|
||||
x0: 0,
|
||||
y0: data.price,
|
||||
x1: data.tick,
|
||||
@ -95,10 +95,10 @@ class RPlot extends Component<{}, PlotState> {
|
||||
shapes: [
|
||||
{
|
||||
type: 'line',
|
||||
x0: this.state.h_price_line.x0,
|
||||
y0: this.state.h_price_line.y0,
|
||||
x1: this.state.h_price_line.x1,
|
||||
y1: this.state.h_price_line.y1,
|
||||
x0: this.state.current_price_line.x0,
|
||||
y0: this.state.current_price_line.y0,
|
||||
x1: this.state.current_price_line.x1,
|
||||
y1: this.state.current_price_line.y1,
|
||||
line: {
|
||||
color: 'rgb(50, 171, 96)',
|
||||
width: 2,
|
||||
|
Loading…
Reference in New Issue
Block a user