ordershapes
This commit is contained in:
@@ -3,7 +3,6 @@ import {invokeCallbacks, prototype} from "@/common.js";
|
||||
import {DataFeed, initFeeDropdown, lookupSymbol} from "@/charts/datafeed.js";
|
||||
import {intervalToSeconds, SingletonCoroutine} from "@/misc.js";
|
||||
import {useStore} from "@/store/store.js";
|
||||
import {dirtyPoints} from "@/charts/chart-misc.js";
|
||||
|
||||
export let widget = null
|
||||
export let chart = null
|
||||
@@ -162,12 +161,17 @@ export function drawShape(shapeType, ...callbacks) {
|
||||
|
||||
|
||||
export function createShape(shapeType, points, options={}, ...callbacks) {
|
||||
const chart = widget.activeChart()
|
||||
drawingCallbacks = null
|
||||
cancelDrawing()
|
||||
options.shape = shapeType.code
|
||||
if (typeof shapeType === 'string' )
|
||||
options.shape = shapeType
|
||||
else
|
||||
options.shape = shapeType.code
|
||||
// programatically adds a shape to the chart
|
||||
let shapeId
|
||||
try {
|
||||
console.log('creating shape', points, options)
|
||||
if (points.time || points.price)
|
||||
shapeId = chart.createShape(points, options)
|
||||
else if (points.length === 1)
|
||||
|
||||
Reference in New Issue
Block a user