@reincharts/coordinates
Crosshair, last-value labels and price lines.
npm install @reincharts/coordinatesEverything here is also re-exported by the umbrella package reincharts.
Components
| Name | Description |
|---|---|
| Crosshair | Crosshair: dashed lines across all panes at the hovered bar and in the hovered pane at the pointer (or the magnet value), with labels on the time axis and on every price axis of the pane. |
| CurrentCoordinate | A dot on a series at the hovered bar (follows the crosshair, also when synced from another chart). |
| EdgeIndicator | A price axis label (and optional line) for the first or last visible value of any accessor. |
| LastValueLabel | Colored labels with the last value of each series of the pane on the price axis. |
| LastValueLine | LastValueLabel with a dotted line across the plot at each last value. |
| PriceLine | A horizontal price line with an axis label and optional title. |
Functions
| Name | Description |
|---|---|
| axesOf | Price axes registered for a scale of a pane. |
| axisBand | Left edge and width of a price axis band relative to the pane plot origin (use plotOrigin = layout.plotLeft for whole-canvas coordinates). |
| axisLabelHeight | Height in pixels of a price axis label box for a theme. |
| crosshairPoint | Computes where the crosshair lines go: snapped to the bar center in index mode (including empty future slots for time data), free in linear mode, magnet-snapped vertically. |
| drawAxisLabel | Draws a label filling the price axis band at a y. |
| drawValueMarkers | Draws price lines / axis labels for one price scale of a pane (ctx at the pane plot origin, unclipped). |
| lastValues | Last values of every visible series in a pane (renderables implementing lastValue()), in z order. |
Types
| Name | Description |
|---|---|
| AxisLabelOptions | |
| CrosshairMode | |
| CrosshairPoint | Resolved crosshair position in whole-canvas coordinates. |
| CrosshairProps | Props of the Crosshair component. |
| CurrentCoordinateProps | Props of the CurrentCoordinate component. |
| EdgeIndicatorProps | Props of the EdgeIndicator component. |
| LastValueEntry | |
| LastValueLabelProps | Props of the LastValueLabel component. |
| PriceLineProps | Props of the PriceLine component. |
| ValueMarker |