@devexperts/dxcharts-lite
Version:
36 lines (35 loc) • 1.83 kB
TypeScript
/*
* Copyright (C) 2019 - 2026 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 { DynamicModelDrawer } from '../components/dynamic-objects/dynamic-objects.drawer';
import { PaneManager } from '../components/pane/pane-manager.component';
import { CanvasModel } from '../model/canvas.model';
import { DataSeriesModel, VisualSeriesPoint } from '../model/data-series.model';
export interface HTSeriesDrawerConfig {
color?: string;
hoverWidth?: number;
}
export interface SeriesDrawer {
draw: (ctx: CanvasRenderingContext2D,
/**
* You can pass two-dimension array to divide series into multiple parts
*/
points: VisualSeriesPoint[][], model: DataSeriesModel, hitTestDrawerConfig: HTSeriesDrawerConfig) => void;
}
export declare const transformToTwoDimension: (points: VisualSeriesPoint[] | VisualSeriesPoint[][]) => VisualSeriesPoint[][];
/**
* Basic data series drawer.
* Have multiple paint tools: linear, histogram, points, text above/below candle and others.
*
* (may support multiple layers in future)
*/
export declare class DataSeriesDrawer implements DynamicModelDrawer<DataSeriesModel> {
private paneManager;
private readonly seriesDrawers;
constructor(paneManager: PaneManager, seriesDrawers: Record<string, SeriesDrawer>);
draw(canvasModel: CanvasModel, model: DataSeriesModel, paneUUID?: string): void;
drawSeries(ctx: CanvasRenderingContext2D, series: DataSeriesModel): void;
}
export declare const setLineWidth: (ctx: CanvasRenderingContext2D, lineWidth: number, dataSeries: DataSeriesModel, hitTestDrawerConfig: HTSeriesDrawerConfig, seriesSelectedWidth?: number) => void;