primeng
Version:
PrimeNG is a premium UI library for Angular featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock,
58 lines (54 loc) • 1.44 kB
TypeScript
import { PassThrough, PassThroughOption } from 'primeng/api';
export { ChartData, ChartOptions, Plugin as ChartPlugin } from 'chart.js';
/**
* Defines the type of chart.
* @group Types
*/
type ChartType = 'bar' | 'line' | 'scatter' | 'bubble' | 'pie' | 'doughnut' | 'polarArea' | 'radar';
/**
* Event emitted when chart data is selected.
* @group Events
*/
interface ChartDataSelectEvent {
/**
* Browser event.
*/
originalEvent: Event;
/**
* Selected element.
*/
element: unknown;
/**
* Selected dataset.
*/
dataset: unknown[];
}
/**
* Custom pass-through(pt) options.
* @template I Type of instance.
*
* @see {@link UIChart.pt}
* @group Interface
*/
interface ChartPassThroughOptions<I = unknown> {
/**
* Used to pass attributes to the host's DOM element.
*/
host?: PassThroughOption<HTMLElement, I>;
/**
* Used to pass attributes to the root's DOM element.
*/
root?: PassThroughOption<HTMLElement, I>;
/**
* Used to pass attributes to the canvas DOM element.
*/
canvas?: PassThroughOption<HTMLCanvasElement, I>;
}
/**
* Defines valid pass-through options in Chart.
* @see {@link ChartPassThroughOptions}
*
* @template I Type of instance.
*/
type ChartPassThrough<I = unknown> = PassThrough<I, ChartPassThroughOptions<I>>;
export type { ChartDataSelectEvent, ChartPassThrough, ChartPassThroughOptions, ChartType };