@devexperts/dxcharts-lite
Version:
25 lines (24 loc) • 1.04 kB
JavaScript
/*
* Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
export class PointsDrawer {
constructor() { }
draw(ctx, allPoints, model, hitTestDrawerConfig) {
allPoints.forEach((points, idx) => {
var _a;
const config = model.getPaintConfig(idx);
const radius = hitTestDrawerConfig.hoverWidth ? hitTestDrawerConfig.hoverWidth / 2 : config.lineWidth;
ctx.fillStyle = (_a = hitTestDrawerConfig.color) !== null && _a !== void 0 ? _a : config.color;
ctx.lineWidth = 1;
points.forEach(p => {
ctx.beginPath();
const x = model.view.toX(p.centerUnit);
const y = model.view.toY(p.close);
ctx.arc(x, y, radius, 0, Math.PI * 2);
ctx.fill();
});
});
}
}