MikeLimp
Posts: 3
Joined: Wed Sep 21, 2022 4:47 pm

X-Range сurrent date and other

Thu Sep 22, 2022 12:41 pm

Hello Highcharts team! There are a couple of questions that I couldn't find answers to

My layout:
highcharts.png
highcharts.png (24.36 KiB) Viewed 59 times
1) The left panel with the checkboxes. I understand formatter can't handle anything other than div/span. Tried to do it through div and before. after clicking on the item I wanted to change the class and change the rendering styles. There is no way to change the value in formatter (like changing the class after the click from off to on) Is there any way to change the value in formatter or should I do this component separately?

2) Is it possible to draw the current time line(plotLine) as on the layout (on the scale of the x-axis) ?

3) Is it possible to click on an empty cell and select the whole line?
At the moment I can only click on yaxis labels or point

User avatar
michal.f
Posts: 745
Joined: Thu Aug 12, 2021 12:04 pm

Re: X-Range сurrent date and other

Fri Sep 23, 2022 3:08 pm

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

1. You need to set yAxis.labels.useHTML to true to display improved HTML elements, another thing is filtering which has been added since Highcharts version 9. To use other HTML tags with their attributes you need to add them to the allow list. You can read more about it in the link to the documentation attached below.

2. Yes, it is possible. The xAxis.currentDateIndicator property is used for this.

3. It is not possible to do that easily using the API options.

Demo: https://jsfiddle.net/BlackLabel/mr7u5wsy/
Docs: https://www.highcharts.com/docs/chart-c ... formatting
API: https://api.highcharts.com/gantt/yAxis.labels.useHTML
https://api.highcharts.com/gantt/xAxis. ... eIndicator

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer

MikeLimp
Posts: 3
Joined: Wed Sep 21, 2022 4:47 pm

Re: X-Range сurrent date and other

Mon Sep 26, 2022 7:45 am

Thanks for the answers.
On point 3: Can I just click on an empty cell and call a function that gets yAxis pos and xAxis time tick (for example yAxis.value: 2, xAxis.value: {start,end} ) ?

User avatar
michal.f
Posts: 745
Joined: Thu Aug 12, 2021 12:04 pm

Re: X-Range сurrent date and other

Mon Sep 26, 2022 2:04 pm

Hello,

A topic related to this has recently appeared on the forum: viewtopic.php?f=19&t=49525

Let me know if that was what you were looking for!
Best regards!
Michał Filipiec
Highcharts Developer

MikeLimp
Posts: 3
Joined: Wed Sep 21, 2022 4:47 pm

Re: X-Range сurrent date and other

Mon Sep 26, 2022 2:47 pm

Thank you very much ! This topic will help me with highlighting the whole line
I asked the question wrong. I'd like to double click on an empty cell to call some modal, which would get the data from xAxis and yAxis and add a new point
In the attached screenshot, the function would get yAxis.value: 'item3', xAxis.value: {x: 4.30, x2: 5.30}
Can I implement something like this?
dbClick.png
dbClick.png (27.77 KiB) Viewed 10 times

Return to “Highcharts Usage”