@nova-ui/charts
Version:
Nova Charts is a library created to provide potential consumers with solutions for various data visualizations that conform with the Nova Design Language. It's designed to solve common patterns identified by UX designers, but also be very flexible so that
24 lines (23 loc) • 1.04 kB
TypeScript
import { ChartTooltipsPlugin, ITooltipPosition } from "./chart-tooltips-plugin";
import { IAccessors, IChartSeries, IDataPoint, IPosition } from "../../common/types";
/**
* This radial tooltips plugin handles special tooltip positioning requirements for donut / pie charts.
*/
export declare class RadialTooltipsPlugin extends ChartTooltipsPlugin {
protected getTooltipPosition(dataPoint: IDataPoint, chartSeries: IChartSeries<IAccessors>): ITooltipPosition;
protected getAbsolutePosition(relativePosition: ITooltipPosition, chartPosition: IPosition): ITooltipPosition;
/**
* Calculate the position for the tooltip overlay based on the angle of the pie slice
*
* @param {number} angle in radians
*/
private getOverlayPosition;
/**
* Calculates what section of the circle does the given angle belong to
*
* @param {number} angle in radians
* @param {number} sections The number of sections the circle is divided into
*/
private getSectionIndex;
private opposite;
}