UNPKG

@amcharts/amcharts5

Version:
35 lines • 1.17 kB
import { Candlestick } from "./Candlestick"; /** * Used to plot an OHLC graphic on an [[OHLCSeries]]. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/candlestick-series/} for more info * @important */ export class OHLC extends Candlestick { _draw() { const display = this._display; display.moveTo(this.get("lowX1", 0), this.get("lowY1", 0)); display.lineTo(this.get("highX1", 0), this.get("highY1", 0)); let w = this.width(); let h = this.height(); if (this.get("orientation") == "vertical") { let lY = h; let hY = 0; display.moveTo(0, lY); display.lineTo(w / 2, lY); display.moveTo(w / 2, hY); display.lineTo(w, hY); } else { let lX = 0; let hX = w; display.moveTo(lX, 0); display.lineTo(lX, h / 2); display.moveTo(hX, h / 2); display.lineTo(hX, h); } } } OHLC.className = "OHLC"; OHLC.classNames = Candlestick.classNames.concat([OHLC.className]); //# sourceMappingURL=OHLC.js.map