UNPKG

@devexperts/dxcharts-lite

Version:
25 lines (24 loc) 1.03 kB
/* * 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/. */ import { setLineWidth } from '../data-series.drawer'; import { buildLinePath } from './data-series-drawers.utils'; export class LinearDrawer { constructor() { } draw(ctx, allPoints, model, hitTestDrawerConfig) { allPoints.forEach((points, idx) => { var _a; const config = model.getPaintConfig(idx); setLineWidth(ctx, config.lineWidth, model, hitTestDrawerConfig, config.hoveredLineWidth); ctx.strokeStyle = (_a = hitTestDrawerConfig.color) !== null && _a !== void 0 ? _a : config.color; this.drawLinePath(ctx, points, model.view); }); } drawLinePath(ctx, points, view) { ctx.beginPath(); buildLinePath(points, ctx, view); ctx.stroke(); } }