primevue-mirror/components/chart/Chart.d.ts

132 lines
2.7 KiB
TypeScript
Raw Normal View History

2023-03-01 12:59:22 +00:00
/**
*
* Chart groups a collection of contents in tabs.
*
* [Live Demo](https://www.primevue.org/chart/)
*
* @module chart
*
*/
2022-12-08 11:04:25 +00:00
import { CanvasHTMLAttributes } from 'vue';
2022-09-06 12:03:37 +00:00
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
2023-03-01 12:59:22 +00:00
/**
* Custom select event.
* @see select
*/
2022-09-06 12:03:37 +00:00
export interface ChartSelectEvent {
/**
* Browser event.
*/
originalEvent: Event;
/**
* Selected element.
*/
element: HTMLElement | any;
/**
* Selected dataset.
*/
dataset: any;
}
2023-03-01 12:59:22 +00:00
/**
* Defines valid properties in Chart component.
*/
2022-09-06 12:03:37 +00:00
export interface ChartProps {
/**
* Type of the chart.
*/
type?: string | undefined;
/**
* Data to display.
*/
data?: object | undefined;
/**
* Options to customize the chart.
*/
options?: object | undefined;
/**
* Used to custom plugins of the chart.
*/
plugins?: any;
/**
* Width of the chart in non-responsive mode.
2023-03-01 12:59:47 +00:00
* @defaultValue 300
2022-09-06 12:03:37 +00:00
*/
width?: number | undefined;
/**
* Height of the chart in non-responsive mode.
2023-03-01 12:59:47 +00:00
* @defaultValue 150
2022-09-06 12:03:37 +00:00
*/
height?: number | undefined;
2022-12-08 11:04:25 +00:00
/**
* Uses to pass all properties of the CanvasHTMLAttributes to canvas element inside the component.
*/
canvasProps?: CanvasHTMLAttributes | undefined;
2022-09-06 12:03:37 +00:00
}
2022-09-14 11:26:01 +00:00
export interface ChartSlots {}
2022-09-06 12:03:37 +00:00
2023-03-01 12:59:22 +00:00
/**
* Defines valid emits in Chart component.
*/
export interface ChartEmits {
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke when a tab gets expanded.
* @param {ChartSelectEvent} event - Custom select event.
*/
2023-03-01 12:59:22 +00:00
select(event: ChartSelectEvent): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke when chart is loaded.
* @param {*} chart - Chart instance.
*/
2023-03-01 12:59:22 +00:00
loaded(chart: any): void;
}
2022-09-06 12:03:37 +00:00
2023-03-01 12:59:22 +00:00
/**
* **PrimeVue - Chart**
*
* _Chart groups a collection of contents in tabs._
*
* [Live Demo](https://www.primevue.org/chart/)
* --- ---
2023-03-03 10:55:20 +00:00
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
2023-03-01 12:59:22 +00:00
*
* @group Component
*
*/
2022-09-06 12:03:37 +00:00
declare class Chart extends ClassComponent<ChartProps, ChartSlots, ChartEmits> {
/**
* Redraws the graph.
*
* @memberof Chart
*/
2023-03-01 12:59:22 +00:00
refresh(): void;
2022-09-06 12:03:37 +00:00
/**
* Destroys the graph first and then creates it again.
*
* @memberof Chart
*/
2023-03-01 12:59:22 +00:00
reinit(): void;
2022-09-06 12:03:37 +00:00
/**
* Returns an HTML string of a legend for that chart. The legend is generated from the legendCallback in the options.
*
* @memberof Chart
*/
2023-03-01 12:59:22 +00:00
generateLegend(): string | any;
2022-09-06 12:03:37 +00:00
/**
* Returns Chart instance.
*
* @memberof Chart
*/
2023-03-01 12:59:22 +00:00
getChart(): any;
2022-09-06 12:03:37 +00:00
}
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
Chart: GlobalComponentConstructor<Chart>;
2022-09-06 12:03:37 +00:00
}
}
export default Chart;