Skip to content

Commit 419f9d0

Browse files
committed
docs: update docs for pageInjections
1 parent 7427277 commit 419f9d0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

adminforth/documentation/docs/tutorial/03-Customization/08-pageInjections.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ Now create file `ApartsPie.vue` in the `custom` folder of your project:
3737
:options="{
3838
chart: {
3939
height: 250,
40+
events: {
41+
dataPointSelection: function (event, chartContext, config) {
42+
if (config.selectedDataPoints[0].length) {
43+
const selectedRoomsCount = data[config.dataPointIndex].rooms;
44+
adminforth.list.updateFilter({field: 'number_of_rooms', operator: 'eq', value: selectedRoomsCount});
45+
} else {
46+
// clear filter
47+
adminforth.list.updateFilter({field: 'number_of_rooms', value: undefined});
48+
}
49+
}
50+
}
4051
},
4152
dataLabels: {
4253
enabled: true,

0 commit comments

Comments
 (0)