Daniel Hansson
Posts: 5
Joined: Wed Nov 23, 2022 2:57 pm

measure annotation - Stop from moving outside chart

Hey!
How do I stop the "measure" annotation from moving outside the chart?
As shown in the demo for measure, the user can move it outside the chart. https://jsfiddle.net/gh/get/library/pur ... d/measure/
Been looking through the documentation without any answers.
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: measure annotation - Stop from moving outside chart

Hello,

What do you mean by "moving outside the chart"? Do you want the plot to stop when it reaches the edge?

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
Daniel Hansson
Posts: 5
Joined: Wed Nov 23, 2022 2:57 pm

Re: measure annotation - Stop from moving outside chart

Yeah. I wish to stop the annotation from moving further as it reaches the edge of the chart.

Cheers!
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: measure annotation - Stop from moving outside chart

Hi,

The API does not have a property that would limit this annotation from going outside the plot, but you can override the function responsible for dragging this element and add logic that will prevent it.

Demo: https://jsfiddle.net/BlackLabel/tvnd95ru/
More about extending higcharts: https://www.highcharts.com/docs/extendi ... highcharts

Regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
Daniel Hansson
Posts: 5
Joined: Wed Nov 23, 2022 2:57 pm

Re: measure annotation - Stop from moving outside chart

Thanks for the quick answer and the solution!
Just a question, how days can I expect to wait when asking a question on the forum, compared to sending it off as an email? I prefer sending off my questions or problems I have with HighCharts here, as opposed to an email, but sometimes the answer can be a roadblock to completing a task.

Best regards!
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: measure annotation - Stop from moving outside chart

Hi, that's great to hear!

We are doing our bests to help and try to answer within 24 hours (on working days, if there are any holidays, it is longer) of receiving your message on the forum and by email. The simplest questions (like post link to docs) take only a few seconds, but sometimes we have to recognize the problem, do some tests and as in this case, propose a custom solution, which takes more time. It depends on the question.

In case of any further questions, feel free to contact us again.
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Stock”