teechart.js 4.0.4 → 5.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3D-COMPATIBILITY.md +45 -0
- package/README.md +463 -27
- package/dist/chunks/chart-p639xVyw.js +16 -0
- package/dist/chunks/chart-p639xVyw.js.map +1 -0
- package/dist/chunks/palette-series-DfyYptK1.js +16 -0
- package/dist/chunks/palette-series-DfyYptK1.js.map +1 -0
- package/dist/chunks/series-DeozLXIv.js +16 -0
- package/dist/chunks/series-DeozLXIv.js.map +1 -0
- package/dist/teechart.3d.esm.js +27 -0
- package/dist/teechart.3d.esm.js.map +1 -0
- package/dist/teechart.auto.esm.js +16 -0
- package/dist/teechart.auto.esm.js.map +1 -0
- package/dist/teechart.core.esm.js +16 -0
- package/dist/teechart.core.esm.js.map +1 -0
- package/dist/teechart.esm.js +16 -0
- package/dist/teechart.esm.js.map +1 -0
- package/dist/teechart.js +14 -3
- package/dist/teechart.js.map +1 -1
- package/dist/teechart.maps.esm.js +16 -0
- package/dist/teechart.maps.esm.js.map +1 -0
- package/dist/types/accessibility.d.ts +29 -0
- package/dist/types/accessibility.d.ts.map +1 -0
- package/dist/types/auto.d.ts +4 -0
- package/dist/types/auto.d.ts.map +1 -0
- package/dist/types/chart-options.d.ts +826 -0
- package/dist/types/chart-options.d.ts.map +1 -0
- package/dist/types/chart.d.ts +252 -0
- package/dist/types/chart.d.ts.map +1 -0
- package/dist/types/checkbox.d.ts +12 -0
- package/dist/types/checkbox.d.ts.map +1 -0
- package/dist/types/core/elements/axes.d.ts +17 -0
- package/dist/types/core/elements/axes.d.ts.map +1 -0
- package/dist/types/core/elements/axis-grid.d.ts +20 -0
- package/dist/types/core/elements/axis-grid.d.ts.map +1 -0
- package/dist/types/core/elements/axis-labels.d.ts +54 -0
- package/dist/types/core/elements/axis-labels.d.ts.map +1 -0
- package/dist/types/core/elements/axis-ticks.d.ts +19 -0
- package/dist/types/core/elements/axis-ticks.d.ts.map +1 -0
- package/dist/types/core/elements/axis-title.d.ts +16 -0
- package/dist/types/core/elements/axis-title.d.ts.map +1 -0
- package/dist/types/core/elements/axis.d.ts +125 -0
- package/dist/types/core/elements/axis.d.ts.map +1 -0
- package/dist/types/core/elements/chart-image.d.ts +13 -0
- package/dist/types/core/elements/chart-image.d.ts.map +1 -0
- package/dist/types/core/elements/font.d.ts +28 -0
- package/dist/types/core/elements/font.d.ts.map +1 -0
- package/dist/types/core/elements/format.d.ts +125 -0
- package/dist/types/core/elements/format.d.ts.map +1 -0
- package/dist/types/core/elements/gradient.d.ts +23 -0
- package/dist/types/core/elements/gradient.d.ts.map +1 -0
- package/dist/types/core/elements/legend-symbol.d.ts +49 -0
- package/dist/types/core/elements/legend-symbol.d.ts.map +1 -0
- package/dist/types/core/elements/legend.d.ts +131 -0
- package/dist/types/core/elements/legend.d.ts.map +1 -0
- package/dist/types/core/elements/margins.d.ts +9 -0
- package/dist/types/core/elements/margins.d.ts.map +1 -0
- package/dist/types/core/elements/panel.d.ts +13 -0
- package/dist/types/core/elements/panel.d.ts.map +1 -0
- package/dist/types/core/elements/scroll.d.ts +14 -0
- package/dist/types/core/elements/scroll.d.ts.map +1 -0
- package/dist/types/core/elements/shadow.d.ts +14 -0
- package/dist/types/core/elements/shadow.d.ts.map +1 -0
- package/dist/types/core/elements/stroke.d.ts +19 -0
- package/dist/types/core/elements/stroke.d.ts.map +1 -0
- package/dist/types/core/elements/wall.d.ts +13 -0
- package/dist/types/core/elements/wall.d.ts.map +1 -0
- package/dist/types/core/elements/zoom.d.ts +33 -0
- package/dist/types/core/elements/zoom.d.ts.map +1 -0
- package/dist/types/core/primitives.d.ts +33 -0
- package/dist/types/core/primitives.d.ts.map +1 -0
- package/dist/types/core.d.ts +96 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/data/data-engine.d.ts +245 -0
- package/dist/types/data/data-engine.d.ts.map +1 -0
- package/dist/types/date.format.d.ts +5 -0
- package/dist/types/date.format.d.ts.map +1 -0
- package/dist/types/declarative-tools.d.ts +6 -0
- package/dist/types/declarative-tools.d.ts.map +1 -0
- package/dist/types/do-http-request.d.ts +2 -0
- package/dist/types/do-http-request.d.ts.map +1 -0
- package/dist/types/dom-tip.d.ts +41 -0
- package/dist/types/dom-tip.d.ts.map +1 -0
- package/dist/types/events.d.ts +82 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/extras.d.ts +18 -0
- package/dist/types/extras.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/interaction.d.ts +67 -0
- package/dist/types/interaction.d.ts.map +1 -0
- package/dist/types/map-series-definition.d.ts +5 -0
- package/dist/types/map-series-definition.d.ts.map +1 -0
- package/dist/types/maps/africa-map.d.ts +10 -0
- package/dist/types/maps/africa-map.d.ts.map +1 -0
- package/dist/types/maps/asia-map.d.ts +10 -0
- package/dist/types/maps/asia-map.d.ts.map +1 -0
- package/dist/types/maps/australia-map.d.ts +10 -0
- package/dist/types/maps/australia-map.d.ts.map +1 -0
- package/dist/types/maps/europe-map.d.ts +10 -0
- package/dist/types/maps/europe-map.d.ts.map +1 -0
- package/dist/types/maps/europe27-map.d.ts +10 -0
- package/dist/types/maps/europe27-map.d.ts.map +1 -0
- package/dist/types/maps/layout-map.d.ts +51 -0
- package/dist/types/maps/layout-map.d.ts.map +1 -0
- package/dist/types/maps/map-types.d.ts +19 -0
- package/dist/types/maps/map-types.d.ts.map +1 -0
- package/dist/types/maps/south-america-map.d.ts +10 -0
- package/dist/types/maps/south-america-map.d.ts.map +1 -0
- package/dist/types/maps/spain-map.d.ts +11 -0
- package/dist/types/maps/spain-map.d.ts.map +1 -0
- package/dist/types/maps/svg-map.d.ts +37 -0
- package/dist/types/maps/svg-map.d.ts.map +1 -0
- package/dist/types/maps/usa-map.d.ts +12 -0
- package/dist/types/maps/usa-map.d.ts.map +1 -0
- package/dist/types/maps/world-map.d.ts +14 -0
- package/dist/types/maps/world-map.d.ts.map +1 -0
- package/dist/types/maps.d.ts +15 -0
- package/dist/types/maps.d.ts.map +1 -0
- package/dist/types/marks-animation.d.ts +16 -0
- package/dist/types/marks-animation.d.ts.map +1 -0
- package/dist/types/modern-theme.d.ts +14 -0
- package/dist/types/modern-theme.d.ts.map +1 -0
- package/dist/types/optional-options.d.ts +6 -0
- package/dist/types/optional-options.d.ts.map +1 -0
- package/dist/types/palette.d.ts +11 -0
- package/dist/types/palette.d.ts.map +1 -0
- package/dist/types/platform.d.ts +27 -0
- package/dist/types/platform.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +80 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/quadrants-plugin.d.ts +45 -0
- package/dist/types/quadrants-plugin.d.ts.map +1 -0
- package/dist/types/register-all.d.ts +3 -0
- package/dist/types/register-all.d.ts.map +1 -0
- package/dist/types/rendering/canvas-graphics.d.ts +65 -0
- package/dist/types/rendering/canvas-graphics.d.ts.map +1 -0
- package/dist/types/rendering/graphics.d.ts +59 -0
- package/dist/types/rendering/graphics.d.ts.map +1 -0
- package/dist/types/rendering/renderer.d.ts +58 -0
- package/dist/types/rendering/renderer.d.ts.map +1 -0
- package/dist/types/rendering/three-graphics.d.ts +22 -0
- package/dist/types/rendering/three-graphics.d.ts.map +1 -0
- package/dist/types/responsive.d.ts +8 -0
- package/dist/types/responsive.d.ts.map +1 -0
- package/dist/types/series/activity-gauge.d.ts +18 -0
- package/dist/types/series/activity-gauge.d.ts.map +1 -0
- package/dist/types/series/arc-gauge.d.ts +74 -0
- package/dist/types/series/arc-gauge.d.ts.map +1 -0
- package/dist/types/series/area.d.ts +24 -0
- package/dist/types/series/area.d.ts.map +1 -0
- package/dist/types/series/bar.d.ts +17 -0
- package/dist/types/series/bar.d.ts.map +1 -0
- package/dist/types/series/box-plot.d.ts +140 -0
- package/dist/types/series/box-plot.d.ts.map +1 -0
- package/dist/types/series/bubble.d.ts +25 -0
- package/dist/types/series/bubble.d.ts.map +1 -0
- package/dist/types/series/bullet.d.ts +86 -0
- package/dist/types/series/bullet.d.ts.map +1 -0
- package/dist/types/series/candle.d.ts +27 -0
- package/dist/types/series/candle.d.ts.map +1 -0
- package/dist/types/series/circular-gauge.d.ts +100 -0
- package/dist/types/series/circular-gauge.d.ts.map +1 -0
- package/dist/types/series/color-series.d.ts +59 -0
- package/dist/types/series/color-series.d.ts.map +1 -0
- package/dist/types/series/composed-series.d.ts +76 -0
- package/dist/types/series/composed-series.d.ts.map +1 -0
- package/dist/types/series/custom-bar.d.ts +63 -0
- package/dist/types/series/custom-bar.d.ts.map +1 -0
- package/dist/types/series/custom-series.d.ts +74 -0
- package/dist/types/series/custom-series.d.ts.map +1 -0
- package/dist/types/series/donut.d.ts +17 -0
- package/dist/types/series/donut.d.ts.map +1 -0
- package/dist/types/series/gantt.d.ts +47 -0
- package/dist/types/series/gantt.d.ts.map +1 -0
- package/dist/types/series/high-low-bar.d.ts +24 -0
- package/dist/types/series/high-low-bar.d.ts.map +1 -0
- package/dist/types/series/histogram.d.ts +36 -0
- package/dist/types/series/histogram.d.ts.map +1 -0
- package/dist/types/series/horiz-area.d.ts +11 -0
- package/dist/types/series/horiz-area.d.ts.map +1 -0
- package/dist/types/series/horiz-bar.d.ts +23 -0
- package/dist/types/series/horiz-bar.d.ts.map +1 -0
- package/dist/types/series/line.d.ts +22 -0
- package/dist/types/series/line.d.ts.map +1 -0
- package/dist/types/series/linear-gauge.d.ts +73 -0
- package/dist/types/series/linear-gauge.d.ts.map +1 -0
- package/dist/types/series/map-series.d.ts +82 -0
- package/dist/types/series/map-series.d.ts.map +1 -0
- package/dist/types/series/numeric-gauge.d.ts +96 -0
- package/dist/types/series/numeric-gauge.d.ts.map +1 -0
- package/dist/types/series/palette-series.d.ts +39 -0
- package/dist/types/series/palette-series.d.ts.map +1 -0
- package/dist/types/series/pie.d.ts +81 -0
- package/dist/types/series/pie.d.ts.map +1 -0
- package/dist/types/series/point-xy.d.ts +13 -0
- package/dist/types/series/point-xy.d.ts.map +1 -0
- package/dist/types/series/polar.d.ts +37 -0
- package/dist/types/series/polar.d.ts.map +1 -0
- package/dist/types/series/sankey.d.ts +90 -0
- package/dist/types/series/sankey.d.ts.map +1 -0
- package/dist/types/series/series-list.d.ts +127 -0
- package/dist/types/series/series-list.d.ts.map +1 -0
- package/dist/types/series/series-list.types.d.ts +43 -0
- package/dist/types/series/series-list.types.d.ts.map +1 -0
- package/dist/types/series/sliced.d.ts +13 -0
- package/dist/types/series/sliced.d.ts.map +1 -0
- package/dist/types/series/surface.d.ts +24 -0
- package/dist/types/series/surface.d.ts.map +1 -0
- package/dist/types/series/treemap.d.ts +107 -0
- package/dist/types/series/treemap.d.ts.map +1 -0
- package/dist/types/series/violin.d.ts +105 -0
- package/dist/types/series/violin.d.ts.map +1 -0
- package/dist/types/series/volume.d.ts +11 -0
- package/dist/types/series/volume.d.ts.map +1 -0
- package/dist/types/series-definitions.d.ts +30 -0
- package/dist/types/series-definitions.d.ts.map +1 -0
- package/dist/types/series-registry.d.ts +37 -0
- package/dist/types/series-registry.d.ts.map +1 -0
- package/dist/types/series-utils.d.ts +29 -0
- package/dist/types/series-utils.d.ts.map +1 -0
- package/dist/types/series.d.ts +342 -0
- package/dist/types/series.d.ts.map +1 -0
- package/dist/types/slider.d.ts +49 -0
- package/dist/types/slider.d.ts.map +1 -0
- package/dist/types/spline.d.ts +2 -0
- package/dist/types/spline.d.ts.map +1 -0
- package/dist/types/table/chart-table.d.ts +27 -0
- package/dist/types/table/chart-table.d.ts.map +1 -0
- package/dist/types/teechart-3d.d.ts +4 -0
- package/dist/types/teechart-3d.d.ts.map +1 -0
- package/dist/types/theme.d.ts +41 -0
- package/dist/types/theme.d.ts.map +1 -0
- package/dist/types/three/chart-3d.d.ts +77 -0
- package/dist/types/three/chart-3d.d.ts.map +1 -0
- package/dist/types/three/chart-options-3d.d.ts +5 -0
- package/dist/types/three/chart-options-3d.d.ts.map +1 -0
- package/dist/types/three/teechart-3d.d.ts +25 -0
- package/dist/types/three/teechart-3d.d.ts.map +1 -0
- package/dist/types/three-context.d.ts +184 -0
- package/dist/types/three-context.d.ts.map +1 -0
- package/dist/types/three-context.types.d.ts +177 -0
- package/dist/types/three-context.types.d.ts.map +1 -0
- package/dist/types/three-parametric-geometry.d.ts +7 -0
- package/dist/types/three-parametric-geometry.d.ts.map +1 -0
- package/dist/types/three.d.ts +6 -0
- package/dist/types/three.d.ts.map +1 -0
- package/dist/types/tools/animate-hover.d.ts +13 -0
- package/dist/types/tools/animate-hover.d.ts.map +1 -0
- package/dist/types/tools/annotation.d.ts +169 -0
- package/dist/types/tools/annotation.d.ts.map +1 -0
- package/dist/types/tools/base-animation.d.ts +83 -0
- package/dist/types/tools/base-animation.d.ts.map +1 -0
- package/dist/types/tools/cursor-tool.d.ts +51 -0
- package/dist/types/tools/cursor-tool.d.ts.map +1 -0
- package/dist/types/tools/drag-tool.d.ts +28 -0
- package/dist/types/tools/drag-tool.d.ts.map +1 -0
- package/dist/types/tools/index.d.ts +8 -0
- package/dist/types/tools/index.d.ts.map +1 -0
- package/dist/types/tools/tool.d.ts +27 -0
- package/dist/types/tools/tool.d.ts.map +1 -0
- package/dist/types/tools/tools.d.ts +33 -0
- package/dist/types/tools/tools.d.ts.map +1 -0
- package/dist/types/utils.d.ts +23 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/worker.d.ts +92 -0
- package/dist/types/worker.d.ts.map +1 -0
- package/package.json +74 -27
- package/dist/Tween.js +0 -13
- package/dist/date.format.js +0 -145
- package/dist/excanvas/canvas.text.js +0 -489
- package/dist/excanvas/excanvas.compiled.js +0 -35
- package/dist/excanvas/excanvas.js +0 -924
- package/dist/excanvas/excanvas_text.js +0 -1416
- package/dist/three.js +0 -990
|
@@ -0,0 +1,826 @@
|
|
|
1
|
+
import type { Chart } from "./chart.js";
|
|
2
|
+
import type { AccessibilityOptions } from "./accessibility.js";
|
|
3
|
+
import type { ChartEventMap, EventListener } from "./events.js";
|
|
4
|
+
import type { ChartPlugin, ChartPluginOptions } from "./plugin.js";
|
|
5
|
+
import type { HistogramNormalize, HistogramRule } from "./series/histogram.js";
|
|
6
|
+
import type { SankeyGraph, SankeyLinkColor } from "./series/sankey.js";
|
|
7
|
+
import type { BoxPlotGroup, BoxPlotLimit, BoxPlotQuantiles, BoxPlotWhisker, BoxPlotWhiskerMode } from "./series/box-plot.js";
|
|
8
|
+
import type { ViolinGroup, ViolinInner, ViolinScale } from "./series/violin.js";
|
|
9
|
+
import type { TreemapColorBy, TreemapNode, TreemapTiling } from "./series/treemap.js";
|
|
10
|
+
import type { Series } from "./series.js";
|
|
11
|
+
import type { MapDefinition } from "./series/map-series.js";
|
|
12
|
+
import type { MarkConnector, MarkPlacement } from "./tools/annotation.js";
|
|
13
|
+
export type { MarkConnector, MarkPlacement } from "./tools/annotation.js";
|
|
14
|
+
import type { ThemeName } from "./theme.js";
|
|
15
|
+
import type { Tool } from "./tools/tool.js";
|
|
16
|
+
type ExtensibleName<T extends string> = T | (string & {});
|
|
17
|
+
export type LegendPosition = "bottom" | "left" | "right" | "top";
|
|
18
|
+
/** Whether the legend lists the series, the points of the first visible series, or chooses by series count. */
|
|
19
|
+
export type LegendStyle = "auto" | "series" | "values";
|
|
20
|
+
/** What each legend item shows for the points of a series. */
|
|
21
|
+
export type LegendValueFormat = "auto" | "index" | "label" | "labelpercent" | "labelvalue" | "percent" | "percentlabel" | "value" | "valuelabel" | "valuepercent";
|
|
22
|
+
/** How a legend item shows and toggles a series: clicking an item hides or shows its series unless "none". */
|
|
23
|
+
export type LegendInteraction = "checkbox" | "linethrough" | "none" | "opacity";
|
|
24
|
+
export type LegendSymbolShape = "diamond" | "ellipse" | "line" | "pill" | "rectangle" | "triangle";
|
|
25
|
+
export type ChartTheme = ExtensibleName<ThemeName>;
|
|
26
|
+
export interface PaletteRegistry {
|
|
27
|
+
castaway: true;
|
|
28
|
+
classic: true;
|
|
29
|
+
cool: true;
|
|
30
|
+
excel: true;
|
|
31
|
+
grayscale: true;
|
|
32
|
+
macOS: true;
|
|
33
|
+
modern: true;
|
|
34
|
+
onBlack: true;
|
|
35
|
+
opera: true;
|
|
36
|
+
pastels: true;
|
|
37
|
+
rainbow: true;
|
|
38
|
+
rainbowWide: true;
|
|
39
|
+
redRiver: true;
|
|
40
|
+
rust: true;
|
|
41
|
+
seaWash: true;
|
|
42
|
+
solid: true;
|
|
43
|
+
teechart: true;
|
|
44
|
+
victorian: true;
|
|
45
|
+
warm: true;
|
|
46
|
+
web: true;
|
|
47
|
+
windowsVista: true;
|
|
48
|
+
windowsxp: true;
|
|
49
|
+
}
|
|
50
|
+
export type PaletteName = ExtensibleName<keyof PaletteRegistry>;
|
|
51
|
+
export type HorizontalAxisName = "bottom" | "top" | "both";
|
|
52
|
+
export type VerticalAxisName = "left" | "right" | "both";
|
|
53
|
+
/** How multiple series of the same type are combined. */
|
|
54
|
+
export type StackMode = "no" | "yes" | "100" | "side" | "sideAll" | "self";
|
|
55
|
+
export type PointerStyle = "cone" | "cross" | "cube" | "cylinder" | "diamond" | "downtriangle" | "ellipse" | "rectangle" | "sphere" | "triangle" | "x";
|
|
56
|
+
export interface MarksOptions {
|
|
57
|
+
visible?: boolean;
|
|
58
|
+
style?: string;
|
|
59
|
+
drawEvery?: number;
|
|
60
|
+
showZero?: boolean;
|
|
61
|
+
/** Fill color for the label background. */
|
|
62
|
+
backgroundColor?: string;
|
|
63
|
+
/** Outline color for the mark label box. Use an empty string to hide the outline. */
|
|
64
|
+
borderColor?: string;
|
|
65
|
+
/** Text color inside the mark label. */
|
|
66
|
+
fontColor?: string;
|
|
67
|
+
/** Text size in pixels. */
|
|
68
|
+
fontSize?: number;
|
|
69
|
+
/** Corner radius, in pixels, for the label background. */
|
|
70
|
+
borderRadius?: number;
|
|
71
|
+
/** Space between the label text and its background edges, in pixels. */
|
|
72
|
+
margins?: {
|
|
73
|
+
left?: number;
|
|
74
|
+
top?: number;
|
|
75
|
+
right?: number;
|
|
76
|
+
bottom?: number;
|
|
77
|
+
};
|
|
78
|
+
/** Position for pie and donut labels. */
|
|
79
|
+
placement?: MarkPlacement;
|
|
80
|
+
/** Connector for outside pie and donut labels. */
|
|
81
|
+
connector?: MarkConnector;
|
|
82
|
+
}
|
|
83
|
+
export interface PointerOptions {
|
|
84
|
+
visible?: boolean;
|
|
85
|
+
style?: PointerStyle;
|
|
86
|
+
width?: number;
|
|
87
|
+
height?: number;
|
|
88
|
+
colorEach?: boolean;
|
|
89
|
+
strokeWidth?: number;
|
|
90
|
+
strokeColor?: string;
|
|
91
|
+
shadow?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/** Visual and visibility options shared by every declarative series type. */
|
|
94
|
+
export interface SeriesStyleOptions {
|
|
95
|
+
/** Stable identity used to match this series across declarative updates and reordering. */
|
|
96
|
+
id?: string;
|
|
97
|
+
label?: string;
|
|
98
|
+
/** Keeps at most this many points when values are appended, dropping the oldest. */
|
|
99
|
+
maxPoints?: number;
|
|
100
|
+
visible?: boolean;
|
|
101
|
+
borderColor?: string;
|
|
102
|
+
backgroundColor?: string;
|
|
103
|
+
borderWidth?: number;
|
|
104
|
+
shadow?: boolean;
|
|
105
|
+
hoverColor?: string;
|
|
106
|
+
hoverEnabled?: boolean;
|
|
107
|
+
gradientVisible?: boolean;
|
|
108
|
+
/** Colors of the series fill gradient. */
|
|
109
|
+
gradientColors?: string[];
|
|
110
|
+
/** Image used to texture the series fill. */
|
|
111
|
+
image?: {
|
|
112
|
+
url: string;
|
|
113
|
+
};
|
|
114
|
+
transparency?: number;
|
|
115
|
+
marks?: MarksOptions;
|
|
116
|
+
/** CSS cursor shown over the series points. */
|
|
117
|
+
cursor?: string;
|
|
118
|
+
/** Paints each point with its own palette color. `"auto"` lets the series decide. */
|
|
119
|
+
colorEach?: boolean | "auto";
|
|
120
|
+
/** How the series appears in the legend. */
|
|
121
|
+
legend?: SeriesLegendOptions;
|
|
122
|
+
}
|
|
123
|
+
/** How one series appears in the legend. */
|
|
124
|
+
export interface SeriesLegendOptions {
|
|
125
|
+
/** Lists the series in the legend; `false` hides it. */
|
|
126
|
+
visible?: boolean;
|
|
127
|
+
/** Overrides the legend symbol of this series. */
|
|
128
|
+
symbol?: {
|
|
129
|
+
style?: LegendSymbolShape;
|
|
130
|
+
color?: string;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/** Options of series drawn against chart axes. */
|
|
134
|
+
export interface AxisSeriesOptions extends SeriesStyleOptions {
|
|
135
|
+
horizAxis?: HorizontalAxisName;
|
|
136
|
+
vertAxis?: VerticalAxisName;
|
|
137
|
+
}
|
|
138
|
+
export type CartesianChartType = "area" | "bar" | "bubble" | "horizArea" | "horizBar" | "line" | "point" | "volume";
|
|
139
|
+
export type CircularChartType = "activityGauge" | "donut" | "pie" | "sliced";
|
|
140
|
+
export type ValueChartType = CartesianChartType | CircularChartType;
|
|
141
|
+
/** One Cartesian point with its own horizontal position and vertical value. */
|
|
142
|
+
export interface CartesianDataPoint {
|
|
143
|
+
x: number | Date;
|
|
144
|
+
y: number;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Series plotted against axes whose data is a list of numbers or objects. Omitting `type` uses the chart level
|
|
148
|
+
* `type`. `stacked`, `smooth` and `stairs` throw when the selected type does not support them.
|
|
149
|
+
*/
|
|
150
|
+
export interface CartesianSeriesOptions extends AxisSeriesOptions {
|
|
151
|
+
type?: CartesianChartType;
|
|
152
|
+
data: number[] | CartesianDataPoint[] | object[];
|
|
153
|
+
/**
|
|
154
|
+
* Horizontal position of each numeric point, when it is not the index. Dates make the bottom axis a date axis,
|
|
155
|
+
* and ascending values let line and area series process only the visible points when zoomed in. It
|
|
156
|
+
* needs one value per point. Use `{ x, y }` data points to keep each position alongside its value.
|
|
157
|
+
*/
|
|
158
|
+
x?: Array<number | Date>;
|
|
159
|
+
/** Object property used for horizontal positions. Defaults to `x` for object data. */
|
|
160
|
+
xKey?: string;
|
|
161
|
+
/** Object property used for vertical values. Defaults to `y` for object data. */
|
|
162
|
+
yKey?: string;
|
|
163
|
+
pointer?: PointerOptions;
|
|
164
|
+
stacked?: StackMode;
|
|
165
|
+
smooth?: number;
|
|
166
|
+
stairs?: boolean;
|
|
167
|
+
/** How line series render null values. */
|
|
168
|
+
treatNulls?: "skip" | "dontPaint";
|
|
169
|
+
barSize?: number;
|
|
170
|
+
}
|
|
171
|
+
/** Pie like series whose data is a list of numbers and that do not use axes. */
|
|
172
|
+
export interface CircularSeriesOptions extends SeriesStyleOptions {
|
|
173
|
+
type?: CircularChartType;
|
|
174
|
+
data: number[];
|
|
175
|
+
/** Maximum pie or donut radius as a percentage of the available radius. */
|
|
176
|
+
maxRadius?: number;
|
|
177
|
+
}
|
|
178
|
+
export type ValueSeriesOptions = CartesianSeriesOptions | CircularSeriesOptions;
|
|
179
|
+
export interface PolarSeriesOptions extends SeriesStyleOptions {
|
|
180
|
+
type: "polar";
|
|
181
|
+
data: number[];
|
|
182
|
+
pointer?: PointerOptions;
|
|
183
|
+
smooth?: number;
|
|
184
|
+
}
|
|
185
|
+
export interface CandleRow {
|
|
186
|
+
open: number;
|
|
187
|
+
high: number;
|
|
188
|
+
low: number;
|
|
189
|
+
close: number;
|
|
190
|
+
/** Optional numeric position; the point index is used when omitted. */
|
|
191
|
+
x?: number;
|
|
192
|
+
}
|
|
193
|
+
/** Financial OHLC series. `type` is required because its data is not a list of numbers. */
|
|
194
|
+
export interface CandleSeriesOptions extends AxisSeriesOptions {
|
|
195
|
+
type: "candle";
|
|
196
|
+
data: CandleRow[];
|
|
197
|
+
style?: "candle" | "bar" | "openclose";
|
|
198
|
+
}
|
|
199
|
+
export interface HighLowRow {
|
|
200
|
+
high: number;
|
|
201
|
+
low: number;
|
|
202
|
+
}
|
|
203
|
+
export interface HighLowBarSeriesOptions extends AxisSeriesOptions {
|
|
204
|
+
type: "highLowBar";
|
|
205
|
+
data: HighLowRow[];
|
|
206
|
+
}
|
|
207
|
+
export interface GanttTask {
|
|
208
|
+
start: number | Date;
|
|
209
|
+
end: number | Date;
|
|
210
|
+
/** Task name; falls back to the chart level label with the same index. */
|
|
211
|
+
label?: string;
|
|
212
|
+
/** Vertical position; the task index is used when omitted. */
|
|
213
|
+
x?: number;
|
|
214
|
+
}
|
|
215
|
+
export interface GanttSeriesOptions extends AxisSeriesOptions {
|
|
216
|
+
type: "gantt";
|
|
217
|
+
data: GanttTask[];
|
|
218
|
+
/** Height of each task bar, as a percentage of its row. */
|
|
219
|
+
height?: number;
|
|
220
|
+
/** Corner radius of each task bar, in pixels. */
|
|
221
|
+
borderRadius?: number;
|
|
222
|
+
/** Task index pairs connected by dependency arrows. */
|
|
223
|
+
nextTasks?: Array<[number, number]>;
|
|
224
|
+
/** Stroke color used for dependency arrows. */
|
|
225
|
+
nextTasksStrokeStyle?: string;
|
|
226
|
+
/** Draw dependency arrows behind or in front of the task bars. */
|
|
227
|
+
nextTasksPosition?: "back" | "front";
|
|
228
|
+
}
|
|
229
|
+
/** Groups raw numbers into bins and draws how many fall in each. */
|
|
230
|
+
export interface HistogramSeriesOptions extends AxisSeriesOptions {
|
|
231
|
+
type: "histogram";
|
|
232
|
+
/** Raw values; they are grouped, not plotted one by one. */
|
|
233
|
+
data: number[];
|
|
234
|
+
/** Number of bins. When omitted, `rule` chooses it. */
|
|
235
|
+
bins?: number;
|
|
236
|
+
/** Width of each bin, in data units. It takes precedence over `bins`. */
|
|
237
|
+
binWidth?: number;
|
|
238
|
+
/** How the number of bins is chosen when neither `bins` nor `binWidth` is set; defaults to "sturges". */
|
|
239
|
+
rule?: HistogramRule;
|
|
240
|
+
/** Bar height: the "count" of values, their "percent" or the "density"; defaults to "count". */
|
|
241
|
+
normalize?: HistogramNormalize;
|
|
242
|
+
}
|
|
243
|
+
/** Draws a box and whiskers for each group, from raw values or from precomputed summaries. */
|
|
244
|
+
export interface BoxPlotSeriesOptions extends AxisSeriesOptions {
|
|
245
|
+
type: "boxPlot";
|
|
246
|
+
/** One item per box: a `{ name, values, color? }` group, a precomputed `{ name, min, q1, median, q3, max, outliers? }` or a plain array of values. */
|
|
247
|
+
data: Array<BoxPlotGroup | number[]>;
|
|
248
|
+
/** Where the whiskers end: "tukey" within `whiskerRange` times the IQR, or "minmax"; defaults to "tukey". */
|
|
249
|
+
whisker?: BoxPlotWhisker;
|
|
250
|
+
/** Multiple of the interquartile range used by the "tukey" whiskers; defaults to 1.5. */
|
|
251
|
+
whiskerRange?: number;
|
|
252
|
+
/** Where "tukey" whiskers end: at the farthest value inside the fences ("nearest") or at the fences ("exact"). */
|
|
253
|
+
whiskerMode?: BoxPlotWhiskerMode;
|
|
254
|
+
/** How quartiles are computed from raw values; defaults to 7 (linear interpolation). */
|
|
255
|
+
quantiles?: BoxPlotQuantiles;
|
|
256
|
+
/** What sets the lowest value of the axis: the "extreme" value, the "box" or the "whisker"; defaults to "extreme". */
|
|
257
|
+
minStats?: BoxPlotLimit;
|
|
258
|
+
/** What sets the highest value of the axis; defaults to "extreme". */
|
|
259
|
+
maxStats?: BoxPlotLimit;
|
|
260
|
+
/** Draws every raw value as a dot; defaults to false. */
|
|
261
|
+
showPoints?: boolean;
|
|
262
|
+
/** Radius of the dots in pixels; defaults to 2.5. */
|
|
263
|
+
pointRadius?: number;
|
|
264
|
+
/** Sideways spread of the dots, from 0 to 1 of the box width; defaults to 0.5. */
|
|
265
|
+
jitter?: number;
|
|
266
|
+
/** Width of a box in percent of its category; defaults to 60. */
|
|
267
|
+
width?: number;
|
|
268
|
+
/** Draws the values beyond the whiskers; defaults to true. */
|
|
269
|
+
showOutliers?: boolean;
|
|
270
|
+
/** Marks the mean of each group of raw values with a diamond; defaults to false. */
|
|
271
|
+
showMean?: boolean;
|
|
272
|
+
/** Opacity of the fill of the box, from 0 to 1. */
|
|
273
|
+
fillOpacity?: number;
|
|
274
|
+
/** Width of the outline in pixels. */
|
|
275
|
+
lineWidth?: number;
|
|
276
|
+
/** Formats the values shown in tooltips. */
|
|
277
|
+
formatValue?: (value: number) => string;
|
|
278
|
+
}
|
|
279
|
+
/** Draws the distribution of each group of raw values as a violin. */
|
|
280
|
+
export interface ViolinSeriesOptions extends AxisSeriesOptions {
|
|
281
|
+
type: "violin";
|
|
282
|
+
/** One item per violin: a `{ name, values, color? }` group or a plain array of values. */
|
|
283
|
+
data: Array<ViolinGroup | number[]>;
|
|
284
|
+
/** Smoothing of the density in data units; 0 or omitted chooses it for each group. */
|
|
285
|
+
bandwidth?: number;
|
|
286
|
+
/** Multiplies the automatic bandwidth: below 1 follows the values more closely, above 1 smooths more; defaults to 1. */
|
|
287
|
+
smoothing?: number;
|
|
288
|
+
/** How far the shapes extend beyond the lowest and highest value, in bandwidths; defaults to 0. */
|
|
289
|
+
cut?: number;
|
|
290
|
+
/** Number of positions where the density is estimated for each violin; defaults to 100. */
|
|
291
|
+
resolution?: number;
|
|
292
|
+
/** Violin widths: all the same ("width"), the same area ("area") or by number of values ("count"). */
|
|
293
|
+
scale?: ViolinScale;
|
|
294
|
+
/** Maximum width of a violin in percent of its category; defaults to 80. */
|
|
295
|
+
width?: number;
|
|
296
|
+
/** What is drawn inside: the "median", a "box" with the quartiles or "none"; defaults to "median". */
|
|
297
|
+
inner?: ViolinInner;
|
|
298
|
+
/** Opacity of the fill, from 0 to 1. */
|
|
299
|
+
fillOpacity?: number;
|
|
300
|
+
/** Width of the outline in pixels; 0 draws none. */
|
|
301
|
+
lineWidth?: number;
|
|
302
|
+
/** Formats the values shown in tooltips. */
|
|
303
|
+
formatValue?: (value: number) => string;
|
|
304
|
+
}
|
|
305
|
+
export interface TreemapSeriesOptions extends SeriesStyleOptions {
|
|
306
|
+
type: "treemap";
|
|
307
|
+
data: TreemapNode;
|
|
308
|
+
/** How the children of a node are arranged; defaults to "squarify". */
|
|
309
|
+
tiling?: TreemapTiling;
|
|
310
|
+
/** What decides the color of a tile; defaults to "branch". */
|
|
311
|
+
colorBy?: TreemapColorBy;
|
|
312
|
+
/** Space between sibling tiles in pixels. */
|
|
313
|
+
padding?: number;
|
|
314
|
+
/** Height of the title band of branches in pixels; 0 hides the bands. */
|
|
315
|
+
headerHeight?: number;
|
|
316
|
+
/** Corner radius of the tiles in pixels. */
|
|
317
|
+
cornerRadius?: number;
|
|
318
|
+
/** Width of the tile outline in pixels; 0 draws none. */
|
|
319
|
+
lineWidth?: number;
|
|
320
|
+
/** Color of the tile outline; the chart background when omitted. */
|
|
321
|
+
borderColor?: string;
|
|
322
|
+
/** Levels drawn below the focused node, 0 for all of them. */
|
|
323
|
+
maxDepth?: number;
|
|
324
|
+
/** Draws the node names; defaults to true. */
|
|
325
|
+
labels?: boolean;
|
|
326
|
+
/** Draws the values under the names of the tiles that have room for them; defaults to true. */
|
|
327
|
+
showValues?: boolean;
|
|
328
|
+
/** Orders siblings from the largest to the smallest; defaults to true. */
|
|
329
|
+
sortByValue?: boolean;
|
|
330
|
+
/** Clicking a branch zooms into it; defaults to true. */
|
|
331
|
+
zoomOnClick?: boolean;
|
|
332
|
+
/** Formats the values shown in labels and tooltips. */
|
|
333
|
+
formatValue?: (value: number) => string;
|
|
334
|
+
}
|
|
335
|
+
export interface SankeySeriesOptions extends SeriesStyleOptions {
|
|
336
|
+
type: "sankey";
|
|
337
|
+
data: SankeyGraph;
|
|
338
|
+
/** Width of the node bars in pixels. */
|
|
339
|
+
nodeWidth?: number;
|
|
340
|
+
/** Minimum vertical space between the nodes of a column in pixels. */
|
|
341
|
+
nodePadding?: number;
|
|
342
|
+
/** Opacity of the links, from 0 to 1. */
|
|
343
|
+
linkOpacity?: number;
|
|
344
|
+
/** Link painting: the color of the source node, of the target node, or a gradient between both. */
|
|
345
|
+
linkColor?: SankeyLinkColor;
|
|
346
|
+
/** Draws the node names and values; defaults to true. */
|
|
347
|
+
labels?: boolean;
|
|
348
|
+
/** Formats the values shown in labels and tooltips. */
|
|
349
|
+
formatValue?: (value: number) => string;
|
|
350
|
+
}
|
|
351
|
+
/** A colored band of a gauge: it ends at `to` and starts where the previous band ends, the first one at `min`. */
|
|
352
|
+
export interface GaugeBand {
|
|
353
|
+
to: number;
|
|
354
|
+
color: string;
|
|
355
|
+
}
|
|
356
|
+
/** A gauge shows a single value between `min` and `max`. */
|
|
357
|
+
interface GaugeBaseOptions extends SeriesStyleOptions {
|
|
358
|
+
data: number;
|
|
359
|
+
min?: number;
|
|
360
|
+
max?: number;
|
|
361
|
+
/** Milliseconds the pointer or arc takes to reach a new value set with `setValue`; 0 disables the animation. */
|
|
362
|
+
animationDuration?: number;
|
|
363
|
+
}
|
|
364
|
+
/** A classic dial: ticks, labels and a hand over a round, rectangular or segment shaped face. */
|
|
365
|
+
export interface CircularGaugeSeriesOptions extends GaugeBaseOptions {
|
|
366
|
+
type: "circularGauge";
|
|
367
|
+
/** Distance between labelled ticks; the range is divided in 20 when omitted. */
|
|
368
|
+
step?: number;
|
|
369
|
+
/** Minor ticks between two labelled ticks; 0 hides them. */
|
|
370
|
+
minorTicks?: number;
|
|
371
|
+
/** Degrees covered by the scale; defaults to 280. */
|
|
372
|
+
angle?: number;
|
|
373
|
+
/** Degrees the scale is turned clockwise. */
|
|
374
|
+
rotation?: number;
|
|
375
|
+
/** The scale runs from `max` to `min`. */
|
|
376
|
+
inverted?: boolean;
|
|
377
|
+
/** Turns the tick labels with the scale. */
|
|
378
|
+
rotateText?: boolean;
|
|
379
|
+
/** Face of the dial; defaults to "circle". */
|
|
380
|
+
shape?: "circle" | "rectangle" | "segment";
|
|
381
|
+
/** Shape of the hand; defaults to "needle". */
|
|
382
|
+
handShape?: "needle" | "rectangle";
|
|
383
|
+
/** Colored bands behind the ticks. */
|
|
384
|
+
ranges?: GaugeBand[];
|
|
385
|
+
/** Text under the value, such as "km/h". */
|
|
386
|
+
units?: string;
|
|
387
|
+
/** Draws the value; defaults to true. */
|
|
388
|
+
showValue?: boolean;
|
|
389
|
+
/** Lets the user drag the hand; defaults to true. */
|
|
390
|
+
draggable?: boolean;
|
|
391
|
+
/** Formats the labels of the scale. */
|
|
392
|
+
formatLabel?: (value: number) => string;
|
|
393
|
+
/** Formats the value shown under the hand. */
|
|
394
|
+
formatValue?: (value: number) => string;
|
|
395
|
+
}
|
|
396
|
+
export interface NumericGaugeSeriesOptions extends GaugeBaseOptions {
|
|
397
|
+
type: "numericGauge";
|
|
398
|
+
}
|
|
399
|
+
/** A flat radial gauge: a track and a rounded arc that grows with the value. */
|
|
400
|
+
export interface ArcGaugeSeriesOptions extends GaugeBaseOptions {
|
|
401
|
+
type: "arcGauge";
|
|
402
|
+
/** Degrees covered by the track, from 180 for a semicircle to 360 for a ring; defaults to 240. */
|
|
403
|
+
angle?: number;
|
|
404
|
+
/** Degrees the track is turned clockwise; 0 leaves the gap at the bottom. */
|
|
405
|
+
rotation?: number;
|
|
406
|
+
/** Width of the track as a percentage of the radius; defaults to 14. */
|
|
407
|
+
thickness?: number;
|
|
408
|
+
/** Rounds the ends of the track and the arc; defaults to true. */
|
|
409
|
+
roundCaps?: boolean;
|
|
410
|
+
/** Fills from the end of the track instead of from the start. */
|
|
411
|
+
inverted?: boolean;
|
|
412
|
+
/** The arc takes the color of the band that contains the value. */
|
|
413
|
+
ranges?: GaugeBand[];
|
|
414
|
+
/** Marks a value with a short line across the track. */
|
|
415
|
+
target?: number;
|
|
416
|
+
/** Text under the value. */
|
|
417
|
+
caption?: string;
|
|
418
|
+
/** Text next to the value, such as "%". */
|
|
419
|
+
units?: string;
|
|
420
|
+
/** Draws the minimum and the maximum under the ends of the track; defaults to true. */
|
|
421
|
+
limits?: boolean;
|
|
422
|
+
/** Draws the value in the middle; defaults to true. */
|
|
423
|
+
showValue?: boolean;
|
|
424
|
+
/** Lets the user drag the arc; defaults to false. */
|
|
425
|
+
draggable?: boolean;
|
|
426
|
+
/** Draws a knob at the end of the arc. */
|
|
427
|
+
knob?: boolean;
|
|
428
|
+
/** Value that dragging snaps to. */
|
|
429
|
+
step?: number;
|
|
430
|
+
/** Formats the value and the limits. */
|
|
431
|
+
formatValue?: (value: number) => string;
|
|
432
|
+
trackColor?: string;
|
|
433
|
+
textColor?: string;
|
|
434
|
+
}
|
|
435
|
+
export type GaugeSeriesOptions = CircularGaugeSeriesOptions | NumericGaugeSeriesOptions | ArcGaugeSeriesOptions;
|
|
436
|
+
export interface BulletSeriesOptions extends AxisSeriesOptions {
|
|
437
|
+
type: "bullet";
|
|
438
|
+
/** Measure of each bullet. */
|
|
439
|
+
data: number[];
|
|
440
|
+
/** Draws bullets vertically instead of horizontally. */
|
|
441
|
+
vertical?: boolean;
|
|
442
|
+
/** Target marker position, relative to the origin; use an array for one target per point. */
|
|
443
|
+
target?: number | number[];
|
|
444
|
+
/** Consecutive qualitative range widths; use an array of arrays for different ranges per point. */
|
|
445
|
+
ranges?: number[] | number[][];
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Maps every declarative series type to its options. Extend it with declaration merging to type
|
|
449
|
+
* series registered with `registerSeriesType`:
|
|
450
|
+
*
|
|
451
|
+
* ```ts
|
|
452
|
+
* declare module "teechart.js" {
|
|
453
|
+
* interface SeriesOptionsRegistry { waterfall: WaterfallSeriesOptions }
|
|
454
|
+
* }
|
|
455
|
+
* ```
|
|
456
|
+
*/
|
|
457
|
+
export interface SeriesOptionsRegistry {
|
|
458
|
+
map: MapSeriesOptions;
|
|
459
|
+
colorGrid: ColorGridSeriesOptions;
|
|
460
|
+
surface: SurfaceSeriesOptions;
|
|
461
|
+
linearGauge: LinearGaugeSeriesOptions;
|
|
462
|
+
activityGauge: CircularSeriesOptions;
|
|
463
|
+
arcGauge: ArcGaugeSeriesOptions;
|
|
464
|
+
area: CartesianSeriesOptions;
|
|
465
|
+
bar: CartesianSeriesOptions;
|
|
466
|
+
bubble: CartesianSeriesOptions;
|
|
467
|
+
boxPlot: BoxPlotSeriesOptions;
|
|
468
|
+
bullet: BulletSeriesOptions;
|
|
469
|
+
candle: CandleSeriesOptions;
|
|
470
|
+
circularGauge: CircularGaugeSeriesOptions;
|
|
471
|
+
donut: CircularSeriesOptions;
|
|
472
|
+
gantt: GanttSeriesOptions;
|
|
473
|
+
highLowBar: HighLowBarSeriesOptions;
|
|
474
|
+
histogram: HistogramSeriesOptions;
|
|
475
|
+
horizArea: CartesianSeriesOptions;
|
|
476
|
+
horizBar: CartesianSeriesOptions;
|
|
477
|
+
line: CartesianSeriesOptions;
|
|
478
|
+
numericGauge: NumericGaugeSeriesOptions;
|
|
479
|
+
pie: CircularSeriesOptions;
|
|
480
|
+
point: CartesianSeriesOptions;
|
|
481
|
+
polar: PolarSeriesOptions;
|
|
482
|
+
sankey: SankeySeriesOptions;
|
|
483
|
+
sliced: CircularSeriesOptions;
|
|
484
|
+
treemap: TreemapSeriesOptions;
|
|
485
|
+
violin: ViolinSeriesOptions;
|
|
486
|
+
volume: CartesianSeriesOptions;
|
|
487
|
+
}
|
|
488
|
+
/** Creates the SVG map when the chart mounts, so options can be declared outside the browser. */
|
|
489
|
+
export interface MapSeriesOptions extends AxisSeriesOptions {
|
|
490
|
+
type: "map";
|
|
491
|
+
data: () => MapDefinition;
|
|
492
|
+
}
|
|
493
|
+
/** One array of cell values per row. */
|
|
494
|
+
export interface ColorGridSeriesOptions extends AxisSeriesOptions {
|
|
495
|
+
type: "colorGrid";
|
|
496
|
+
data: number[][];
|
|
497
|
+
}
|
|
498
|
+
export interface SurfaceSeriesOptions extends AxisSeriesOptions {
|
|
499
|
+
type: "surface";
|
|
500
|
+
data: number[][];
|
|
501
|
+
wireFrame?: boolean;
|
|
502
|
+
}
|
|
503
|
+
export interface LinearGaugeSeriesOptions extends SeriesStyleOptions {
|
|
504
|
+
type: "linearGauge";
|
|
505
|
+
data: number;
|
|
506
|
+
min?: number;
|
|
507
|
+
max?: number;
|
|
508
|
+
}
|
|
509
|
+
export type ChartType = keyof SeriesOptionsRegistry;
|
|
510
|
+
export type SeriesOptions = SeriesOptionsRegistry[ChartType];
|
|
511
|
+
export interface ChartDataOptions {
|
|
512
|
+
labels?: string[];
|
|
513
|
+
series: SeriesOptions[];
|
|
514
|
+
}
|
|
515
|
+
export interface AxisOptions {
|
|
516
|
+
visible?: boolean;
|
|
517
|
+
title?: string;
|
|
518
|
+
minimum?: number;
|
|
519
|
+
maximum?: number;
|
|
520
|
+
increment?: number;
|
|
521
|
+
roundFirst?: boolean;
|
|
522
|
+
titleVisible?: boolean;
|
|
523
|
+
titleColor?: string;
|
|
524
|
+
titleFontSize?: number;
|
|
525
|
+
ticksVisible?: boolean;
|
|
526
|
+
/** Position of the axis as a percentage across the chart. */
|
|
527
|
+
position?: number;
|
|
528
|
+
innerTicksVisible?: boolean;
|
|
529
|
+
minorTicksVisible?: boolean;
|
|
530
|
+
lineColor?: string;
|
|
531
|
+
lineWidth?: number;
|
|
532
|
+
inverted?: boolean;
|
|
533
|
+
log?: boolean;
|
|
534
|
+
headroom?: number;
|
|
535
|
+
grid?: {
|
|
536
|
+
visible?: boolean;
|
|
537
|
+
centered?: boolean;
|
|
538
|
+
lineDash?: boolean;
|
|
539
|
+
lineColor?: string;
|
|
540
|
+
lineWidth?: number;
|
|
541
|
+
/** Fill color of alternating grid bands; an empty string disables the fill. */
|
|
542
|
+
bandColor?: string;
|
|
543
|
+
};
|
|
544
|
+
labels?: {
|
|
545
|
+
visible?: boolean;
|
|
546
|
+
decimals?: number;
|
|
547
|
+
fixedDecimals?: boolean;
|
|
548
|
+
rotation?: number;
|
|
549
|
+
labelStyle?: string;
|
|
550
|
+
dateFormat?: string;
|
|
551
|
+
valueFormat?: string;
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
export interface ZoomOptions {
|
|
555
|
+
enabled?: boolean;
|
|
556
|
+
direction?: "both" | "horizontal" | "vertical";
|
|
557
|
+
keepAspect?: boolean;
|
|
558
|
+
mouseButton?: number;
|
|
559
|
+
wheel?: {
|
|
560
|
+
enabled?: boolean;
|
|
561
|
+
factor?: number;
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
export interface ScrollOptions {
|
|
565
|
+
enabled?: boolean;
|
|
566
|
+
direction?: "both" | "horizontal" | "vertical";
|
|
567
|
+
mouseButton?: number;
|
|
568
|
+
}
|
|
569
|
+
export interface PanelOptions {
|
|
570
|
+
backgroundColor?: string;
|
|
571
|
+
borderColor?: string;
|
|
572
|
+
borderWidth?: number;
|
|
573
|
+
transparent?: boolean;
|
|
574
|
+
shadow?: boolean;
|
|
575
|
+
/** Corner radius of the chart panel, in pixels. */
|
|
576
|
+
borderRadius?: number;
|
|
577
|
+
/** Enables a panel fill gradient. */
|
|
578
|
+
gradientVisible?: boolean;
|
|
579
|
+
/** Colors used by the panel fill gradient. */
|
|
580
|
+
gradientColors?: string[];
|
|
581
|
+
margins?: {
|
|
582
|
+
left?: number;
|
|
583
|
+
top?: number;
|
|
584
|
+
right?: number;
|
|
585
|
+
bottom?: number;
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
export interface DOMTipOptions {
|
|
589
|
+
enabled?: boolean;
|
|
590
|
+
}
|
|
591
|
+
export interface TooltipOptions {
|
|
592
|
+
enabled?: boolean;
|
|
593
|
+
/** Shows visible cartesian series at the hovered category or x value in the default tooltip. */
|
|
594
|
+
shared?: boolean;
|
|
595
|
+
render?: "dom" | "canvas";
|
|
596
|
+
autoHide?: boolean;
|
|
597
|
+
delay?: number;
|
|
598
|
+
animated?: number;
|
|
599
|
+
autoRedraw?: boolean;
|
|
600
|
+
findPoint?: boolean;
|
|
601
|
+
/** When true, the DOM tooltip follows the pointer instead of staying anchored to the hovered point. Defaults to false. */
|
|
602
|
+
followCursor?: boolean;
|
|
603
|
+
realTime?: boolean;
|
|
604
|
+
/** Adds x value, share of total, difference from the average, extremes and position to the DOM tooltip. */
|
|
605
|
+
extended?: boolean;
|
|
606
|
+
domStyle?: string;
|
|
607
|
+
format?: (series: Series, index: number) => string | Promise<string>;
|
|
608
|
+
pointer?: {
|
|
609
|
+
visible?: boolean;
|
|
610
|
+
fill?: string;
|
|
611
|
+
firstCircleRadius?: number;
|
|
612
|
+
secondCircleRadius?: number;
|
|
613
|
+
firstCircleOpacity?: number;
|
|
614
|
+
secondCircleOpacity?: number;
|
|
615
|
+
animationVisible?: boolean;
|
|
616
|
+
animationDuration?: number;
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
export interface AnimationOptions {
|
|
620
|
+
/** Duration in milliseconds. */
|
|
621
|
+
duration?: number;
|
|
622
|
+
/** Animation style. Defaults to `"axis"`. */
|
|
623
|
+
kind?: "axis" | "left" | "top" | "right" | "bottom" | "x" | "y" | "each" | "all" | "zoomin" | "zoomout";
|
|
624
|
+
mode?: "linear" | "exponential";
|
|
625
|
+
/** Fades the listed elements in while the series animate. */
|
|
626
|
+
fade?: {
|
|
627
|
+
duration?: number;
|
|
628
|
+
series?: boolean;
|
|
629
|
+
marks?: boolean;
|
|
630
|
+
legend?: boolean;
|
|
631
|
+
title?: boolean;
|
|
632
|
+
axes?: boolean;
|
|
633
|
+
panel?: boolean;
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
export interface CursorToolOptions {
|
|
637
|
+
enabled?: boolean;
|
|
638
|
+
direction?: "both" | "horizontal" | "vertical";
|
|
639
|
+
render?: "full" | "copy" | "layer";
|
|
640
|
+
followMouse?: boolean;
|
|
641
|
+
color?: string;
|
|
642
|
+
width?: number;
|
|
643
|
+
symbol?: "circle" | "square" | "diamond" | "none";
|
|
644
|
+
symbolSize?: number;
|
|
645
|
+
}
|
|
646
|
+
export interface DragToolOptions {
|
|
647
|
+
enabled?: boolean;
|
|
648
|
+
}
|
|
649
|
+
export interface AnnotationOptions {
|
|
650
|
+
text: string;
|
|
651
|
+
/** Left position in pixels. */
|
|
652
|
+
x?: number;
|
|
653
|
+
/** Top position in pixels. */
|
|
654
|
+
y?: number;
|
|
655
|
+
visible?: boolean;
|
|
656
|
+
transparent?: boolean;
|
|
657
|
+
backgroundColor?: string;
|
|
658
|
+
borderColor?: string;
|
|
659
|
+
borderWidth?: number;
|
|
660
|
+
fontColor?: string;
|
|
661
|
+
fontSize?: number;
|
|
662
|
+
fontFamily?: string;
|
|
663
|
+
}
|
|
664
|
+
export interface ToolsOptions {
|
|
665
|
+
cursor?: CursorToolOptions;
|
|
666
|
+
drag?: DragToolOptions;
|
|
667
|
+
annotations?: AnnotationOptions[];
|
|
668
|
+
}
|
|
669
|
+
/** Listeners for the events of a chart, by event name. See `ChartEventMap` for their arguments. */
|
|
670
|
+
export type ChartListeners = {
|
|
671
|
+
[K in keyof ChartEventMap]?: EventListener<ChartEventMap[K]>;
|
|
672
|
+
};
|
|
673
|
+
/** Declarative chart title settings. */
|
|
674
|
+
export interface ChartTitleOptions {
|
|
675
|
+
text?: string;
|
|
676
|
+
visible?: boolean;
|
|
677
|
+
fontSize?: number;
|
|
678
|
+
fontFamily?: string;
|
|
679
|
+
color?: string;
|
|
680
|
+
expand?: boolean;
|
|
681
|
+
}
|
|
682
|
+
export interface ChartOptions {
|
|
683
|
+
/** Plugins used only by this chart, in addition to globally registered plugins. */
|
|
684
|
+
plugins?: ChartPlugin[];
|
|
685
|
+
/** Per-chart plugin options keyed by id. Use `false` to disable a registered plugin on this chart. */
|
|
686
|
+
pluginOptions?: ChartPluginOptions;
|
|
687
|
+
/** Series type used by series that do not declare their own. Defaults to `"line"`. */
|
|
688
|
+
type?: ChartType;
|
|
689
|
+
data?: ChartDataOptions;
|
|
690
|
+
title?: string | ChartTitleOptions;
|
|
691
|
+
subtitle?: string;
|
|
692
|
+
footer?: string;
|
|
693
|
+
/**
|
|
694
|
+
* Theme applied when the chart is created. Defaults to `"minimal"`; use `null` to keep the engine
|
|
695
|
+
* defaults untouched. Theme and palette are applied before the rest of the options.
|
|
696
|
+
*/
|
|
697
|
+
theme?: ChartTheme | null;
|
|
698
|
+
palette?: PaletteName | string[];
|
|
699
|
+
legend?: {
|
|
700
|
+
visible?: boolean;
|
|
701
|
+
position?: LegendPosition;
|
|
702
|
+
/** Text drawn above a vertical legend. */
|
|
703
|
+
title?: string;
|
|
704
|
+
style?: LegendStyle;
|
|
705
|
+
valueFormat?: LegendValueFormat;
|
|
706
|
+
interaction?: LegendInteraction;
|
|
707
|
+
/** Lists the items in reverse order. */
|
|
708
|
+
inverted?: boolean;
|
|
709
|
+
/** Draws each item text with the color of its series or point. */
|
|
710
|
+
fontColor?: boolean;
|
|
711
|
+
fontSize?: number;
|
|
712
|
+
/** Item text color. */
|
|
713
|
+
color?: string;
|
|
714
|
+
/** Item text color under the mouse; an empty string keeps `color`. */
|
|
715
|
+
hoverColor?: string;
|
|
716
|
+
/** Fill of the rounded highlight behind the item under the mouse; an empty string draws none. */
|
|
717
|
+
hoverBackground?: string;
|
|
718
|
+
/** Legend background; `null` makes it transparent. */
|
|
719
|
+
background?: string | null;
|
|
720
|
+
/** Horizontal space between the items of a horizontal legend, in pixels; use `rowGap` for vertical legends. */
|
|
721
|
+
itemGap?: number;
|
|
722
|
+
/** Vertical space between rows of items, in pixels. */
|
|
723
|
+
rowGap?: number;
|
|
724
|
+
symbol?: {
|
|
725
|
+
style?: LegendSymbolShape;
|
|
726
|
+
/** Sets both the width and the height of the symbol, in pixels. */
|
|
727
|
+
size?: number;
|
|
728
|
+
width?: number;
|
|
729
|
+
height?: number;
|
|
730
|
+
/** Space between the symbol and the item text, in pixels. */
|
|
731
|
+
padding?: number;
|
|
732
|
+
/** Corner radius of rectangle symbols, in pixels. */
|
|
733
|
+
radius?: number;
|
|
734
|
+
/** Shows the line and pointer style from each series in the legend. */
|
|
735
|
+
useSeriesPointer?: boolean;
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
axes?: {
|
|
739
|
+
bottom?: AxisOptions;
|
|
740
|
+
left?: AxisOptions;
|
|
741
|
+
top?: AxisOptions;
|
|
742
|
+
right?: AxisOptions;
|
|
743
|
+
};
|
|
744
|
+
panel?: PanelOptions;
|
|
745
|
+
aspect?: {
|
|
746
|
+
clip?: boolean;
|
|
747
|
+
view3d?: boolean;
|
|
748
|
+
};
|
|
749
|
+
walls?: {
|
|
750
|
+
visible?: boolean;
|
|
751
|
+
};
|
|
752
|
+
domTip?: DOMTipOptions;
|
|
753
|
+
tooltip?: TooltipOptions;
|
|
754
|
+
zoom?: ZoomOptions;
|
|
755
|
+
scroll?: ScrollOptions;
|
|
756
|
+
/**
|
|
757
|
+
* Device pixels per drawing unit, or `"auto"` for `window.devicePixelRatio`. Renders sharper on high
|
|
758
|
+
* density screens at the cost of more pixels to paint. Defaults to 1.
|
|
759
|
+
*/
|
|
760
|
+
pixelRatio?: number | "auto";
|
|
761
|
+
/** Labels the canvas for screen readers, which cannot read what is painted on it. */
|
|
762
|
+
accessibility?: AccessibilityOptions;
|
|
763
|
+
/**
|
|
764
|
+
* Resizes the chart whenever its canvas changes display size, using `ResizeObserver`. The observer is
|
|
765
|
+
* removed when the chart is destroyed.
|
|
766
|
+
*/
|
|
767
|
+
responsive?: boolean;
|
|
768
|
+
/** Plays an entrance animation once the series are added. */
|
|
769
|
+
animation?: AnimationOptions;
|
|
770
|
+
tools?: ToolsOptions;
|
|
771
|
+
/**
|
|
772
|
+
* Event listeners. They are attached to the chart, replaced as a group when `on` is set again, and
|
|
773
|
+
* removed by `Chart.destroy`. Use `chart.on` for listeners that are not part of the options.
|
|
774
|
+
*/
|
|
775
|
+
on?: ChartListeners;
|
|
776
|
+
}
|
|
777
|
+
/** Chart option sections that can be restored to TeeChart.js defaults. */
|
|
778
|
+
export type ResettableChartOption = "data" | "domTip" | "footer" | "legend" | "on" | "palette" | "panel" | "pluginOptions" | "scroll" | "subtitle" | "theme" | "title" | "tooltip" | "type" | "zoom";
|
|
779
|
+
export declare function isChartOptions(value: unknown): value is ChartOptions;
|
|
780
|
+
interface OptionSections {
|
|
781
|
+
tools: (chart: Chart, options: ToolsOptions) => void;
|
|
782
|
+
animation: (chart: Chart, options: AnimationOptions) => void;
|
|
783
|
+
/** Returns a function that stops keeping the accessible texts up to date. */
|
|
784
|
+
accessibility: (chart: Chart, options: AccessibilityOptions) => () => void;
|
|
785
|
+
/** Returns a function that stops observing the canvas size. */
|
|
786
|
+
responsive: (chart: Chart) => () => void;
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* Enables a chart option section whose implementation is kept out of the core bundle. See
|
|
790
|
+
* `registerAllOptions`.
|
|
791
|
+
* @internal
|
|
792
|
+
*/
|
|
793
|
+
export declare function registerOptionSection<K extends keyof OptionSections>(name: K, apply: OptionSections[K]): void;
|
|
794
|
+
/**
|
|
795
|
+
* Returns the chart tool of the given class, adding one when the chart has none.
|
|
796
|
+
* @internal
|
|
797
|
+
*/
|
|
798
|
+
export declare function findOrAddTool<T extends Tool>(chart: Chart, ToolClass: new (chart: Chart) => T): T;
|
|
799
|
+
/** Applies the options a chart is created with: the default theme first, then everything else. */
|
|
800
|
+
export declare function applyChartOptions(chart: Chart, options: ChartOptions): void;
|
|
801
|
+
/**
|
|
802
|
+
* Applies a patch over the options already applied to the chart. Only the given keys change, series
|
|
803
|
+
* are matched by position, and a theme or palette reapplies the options that refine them.
|
|
804
|
+
*/
|
|
805
|
+
export declare function updateChartOptions(chart: Chart, patch: ChartOptions): void;
|
|
806
|
+
/** Restores the selected declarative option sections to their TeeChart.js defaults. */
|
|
807
|
+
export declare function resetChartOptions(chart: Chart, sections?: readonly ResettableChartOption[]): void;
|
|
808
|
+
/** Returns a copy of the declarative options applied to the chart so far. */
|
|
809
|
+
export declare function getChartOptions(chart: Chart): ChartOptions;
|
|
810
|
+
/**
|
|
811
|
+
* How to bring a chart that was built from `previous` in line with `next`: `"none"` when they are
|
|
812
|
+
* equivalent, `"patch"` when `Chart.setOptions` can do it, and `"recreate"` when a value was removed or
|
|
813
|
+
* the plugin definitions changed.
|
|
814
|
+
*/
|
|
815
|
+
export type ChartOptionsChange = "none" | "patch" | "recreate";
|
|
816
|
+
export interface ChartOptionsComparison {
|
|
817
|
+
change: ChartOptionsChange;
|
|
818
|
+
/**
|
|
819
|
+
* What to pass to `Chart.setOptions`: only the top level sections whose value changed, so that an
|
|
820
|
+
* unchanged `theme` is not reapplied and an unchanged `animation` does not play again. For
|
|
821
|
+
* `"recreate"` it holds all of `next`, ready for the new chart.
|
|
822
|
+
*/
|
|
823
|
+
patch: ChartOptions;
|
|
824
|
+
}
|
|
825
|
+
export declare function compareChartOptions(previous: ChartOptions | undefined, next: ChartOptions | undefined): ChartOptionsComparison;
|
|
826
|
+
//# sourceMappingURL=chart-options.d.ts.map
|