@mui/x-charts
Version:
The community edition of MUI X Charts components.
30 lines • 1.35 kB
TypeScript
import { type ChartDrawingArea } from "./useDrawingArea.js";
import { type AxisId, type ComputedXAxis, type ComputedYAxis } from "../models/axis.js";
export interface AxisCoordinates {
left: number;
top: number;
right: number;
bottom: number;
}
export declare function getXAxisCoordinates(drawingArea: ChartDrawingArea, computedAxis: {
position?: ComputedXAxis['position'];
offset: number;
height: number;
}): AxisCoordinates | null;
/**
* Get the coordinates of the given X axis. The coordinates are relative to the SVG's origin.
* @param axisId The id of the X axis.
* @returns {AxisCoordinates | null} The coordinates of the X axis or null if the axis does not exist or has position: 'none'.
*/
export declare function useXAxisCoordinates(axisId: AxisId): AxisCoordinates | null;
export declare function getYAxisCoordinates(drawingArea: ChartDrawingArea, computedAxis: {
position?: ComputedYAxis['position'];
offset: number;
width: number;
}): AxisCoordinates | null;
/**
* Returns the coordinates of the given Y axis. The coordinates are relative to the SVG's origin.
* @param axisId The id of the Y axis.
* @returns {AxisCoordinates | null} The coordinates of the Y axis or null if the axis does not exist or has position: 'none'.
*/
export declare function useYAxisCoordinates(axisId: AxisId): AxisCoordinates | null;