devextreme
Version:
JavaScript/TypeScript Component Suite for Responsive Web Development
51 lines (50 loc) • 2.01 kB
JavaScript
/**
* DevExtreme (esm/__internal/viz/series/points/stock_point.js)
* Version: 25.2.8
* Build date: Mon Jun 08 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
extend
} from "../../../../core/utils/extend";
import {
isNumeric
} from "../../../../core/utils/type";
import candlestickPoint from "../../../viz/series/points/candlestick_point";
const _extend = extend;
const _isNumeric = isNumeric;
export default _extend({}, candlestickPoint, {
_getPoints() {
const createPoint = this._options.rotated ? function(x, y) {
return [y, x]
} : function(x, y) {
return [x, y]
};
const openYExist = _isNumeric(this.openY);
const closeYExist = _isNumeric(this.closeY);
const x = this.x;
const width = this.width;
let points = [].concat(createPoint(x, this.highY));
openYExist && (points = points.concat(createPoint(x, this.openY)));
openYExist && (points = points.concat(createPoint(x - width / 2, this.openY)));
openYExist && (points = points.concat(createPoint(x, this.openY)));
closeYExist && (points = points.concat(createPoint(x, this.closeY)));
closeYExist && (points = points.concat(createPoint(x + width / 2, this.closeY)));
closeYExist && (points = points.concat(createPoint(x, this.closeY)));
points = points.concat(createPoint(x, this.lowY));
return points
},
_drawMarkerInGroup(group, attributes, renderer) {
this.graphic = renderer.path(this._getPoints(), "line").attr({
"stroke-linecap": "square"
}).attr(attributes).data({
"chart-data-point": this
}).sharp().append(group)
},
_getMinTrackerWidth() {
const width = 2 + this._styles.normal["stroke-width"];
return width + width % 2
}
});