adziu
Posts: 13
Joined: Wed Mar 27, 2024 10:44 am

Editable options in KPI component - translation

Hi,

Is there any way to translate (or override) the editableOptions name in your KPI component? As far as I notice, "Value," "Column name," and "Value format" are hardcoded. In my opinion, this is not the correct way to add extra options within your KPI component.

Image
Attachments
Zrzut ekranu z 2024-09-02 15-49-33.png
Zrzut ekranu z 2024-09-02 15-49-33.png (47.91 KiB) Viewed 431 times
User avatar
dawid.d
Site Moderator
Posts: 1084
Joined: Thu Oct 06, 2022 11:31 am

Re: Editable options in KPI component - translation

Hello,

Thanks for the question!

You can edit options for an individual component instance in its options:
Demo: https://jsfiddle.net/BlackLabel/sxwkqar0/

Or for all components of one type, e.g. KPI:
Demo: https://jsfiddle.net/BlackLabel/xLy7evt3/

Is that what you were looking for?
Best regards
Dawid Draguła
Highcharts Developer
adziu
Posts: 13
Joined: Wed Mar 27, 2024 10:44 am

Re: Editable options in KPI component - translation

Absolutely!

That's exactly what I was looking for. Thank you so much!

Is it also possible to modify the cellToolbar in edit mode for specific types of components (e.g., KPI)? I'd like to add an additional option (icon) to the toolbar, as shown below. I'm using React, so if you could provide an example in this framework, that would be great.


Image
Attachments
Zrzut ekranu z 2024-09-03 16-24-11.png
Zrzut ekranu z 2024-09-03 16-24-11.png (8.87 KiB) Viewed 400 times
User avatar
dawid.d
Site Moderator
Posts: 1084
Joined: Thu Oct 06, 2022 11:31 am

Re: Editable options in KPI component - translation

Hi!

Yes, it's possible, by extending the `getItemsConfig` static method in the CellEditToolbar class, and disabling it for the other component types in `showToolbar`. See the demo below.

Demo: https://jsfiddle.net/BlackLabel/tqweg15m/

Best regards!
Dawid Draguła
Highcharts Developer

Return to “Highcharts Dashboards”