Deinko
Posts: 16
Joined: Tue Nov 29, 2022 12:53 pm

Flags custom images

Hi! I'm trying to implement flags as custom images using React. But unfortunately, flag shapes not working with an image, as it said here https://api.highcharts.com/highstock/series.flags.shape

here is my code:
Screenshot 2022-11-29 at 13.52.05.png
Screenshot 2022-11-29 at 13.52.05.png (105.69 KiB) Viewed 257 times
And the flag is always shown as a letter A:
Screenshot 2022-11-29 at 13.52.18.png
Screenshot 2022-11-29 at 13.52.18.png (230.77 KiB) Viewed 257 times
Deinko
Posts: 16
Joined: Tue Nov 29, 2022 12:53 pm

Re: Flags custom images

I figured that out! It works with SVG translation to base64 and passing it like this:

Code: Select all

        shape:  'url(data:image/svg+xml;base64,...)' as any,
User avatar
dawid.d
Posts: 807
Joined: Thu Oct 06, 2022 11:31 am

Re: Flags custom images

Welcome to our forum!

That's great to hear! In case of any further questions, feel free to contact us again.

Regards
Dawid Draguła
Highcharts Developer

Return to “Highcharts Stock”