diff --git a/api-generator/components/chart.js b/api-generator/components/chart.js index d06fb1ff5..ab89d6800 100644 --- a/api-generator/components/chart.js +++ b/api-generator/components/chart.js @@ -17,6 +17,12 @@ const ChartProps = [ default: "null", description: "Options to customize the chart." }, + { + name: "plugins", + type: "any", + default: "null", + description: "Used to custom plugins of the chart." + }, { name: "width", type: "number", @@ -62,6 +68,17 @@ const ChartEvents = [ description: "Index of the data in dataset" } ] + }, + { + name: "loaded", + description: "Callback to invoke when chart is loaded.", + arguments: [ + { + name: "chart", + type: "object", + description: "Chart instance." + } + ] } ]; diff --git a/src/components/chart/Chart.d.ts b/src/components/chart/Chart.d.ts index 95a1c6f77..eb0ea4ba5 100755 --- a/src/components/chart/Chart.d.ts +++ b/src/components/chart/Chart.d.ts @@ -28,6 +28,10 @@ export interface ChartProps { * 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. * Default value is 300. @@ -49,6 +53,11 @@ export declare type ChartEmits = { * @param {ChartSelectEvent} event - Custom select event. */ 'select': (event: ChartSelectEvent) => void; + /** + * Callback to invoke when chart is loaded. + * @param {*} chart - Chart instance. + */ + 'loaded': (chart: any) => void; } declare class Chart extends ClassComponent { @@ -70,6 +79,12 @@ declare class Chart extends ClassComponent { * @memberof Chart */ generateLegend: () => string | any; + /** + * Returns Chart instance. + * + * @memberof Chart + */ + getChart: () => any; } declare module '@vue/runtime-core' { diff --git a/src/components/chart/Chart.vue b/src/components/chart/Chart.vue index 6d1753d6e..7520d5e84 100755 --- a/src/components/chart/Chart.vue +++ b/src/components/chart/Chart.vue @@ -7,11 +7,12 @@