ShalomBar
Posts: 2
Joined: Tue Dec 07, 2021 10:48 am

xaxis custom label with react component

Hi,
I want to customize the x-axis labels not by a label formatter in which jsx can be written(with set useHtml true) but by a custom component.
I have code that works with class components and I'm trying to convert it to a functional component and it does not work. I would like for you to help me with this or give me a solution that works without class components.
My example that works with class components - https://codesandbox.io/s/highcharts-rea ... =/demo.jsx.
thanks.
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: xaxis custom label with react component

Hi,

Welcome to our forum and thanks for contacting us with your question!

This question has already appeared in a thread on Stack Overflow (https://stackoverflow.com/questions/666 ... highcharts). Check if it will help you and let me know if that was what you were looking for!

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
ShalomBar
Posts: 2
Joined: Tue Dec 07, 2021 10:48 am

Re: xaxis custom label with react component

michal.f wrote: Wed Dec 08, 2021 1:21 pm Hi,

Welcome to our forum and thanks for contacting us with your question!

This question has already appeared in a thread on Stack Overflow (https://stackoverflow.com/questions/666 ... highcharts). Check if it will help you and let me know if that was what you were looking for!

Best regards!

no, if I want that the ticks labels will be interactive with events of onClick or some other event this will not work.
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: xaxis custom label with react component

Hi,

So you can check out this demo, it is an example from the documentation converted to a function component, it should be what you are looking for.

Demo: https://codesandbox.io/s/highcharts-rea ... rked-4ifzj
Docs: https://github.com/highcharts/highchart ... ts-element

Feel free to ask any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Usage”