pfc4ever
Posts: 17
Joined: Tue Mar 23, 2021 7:31 pm

X-range drag and drop validation before dropping chart bar

Hi guys,

Image

i wanted to ask, when we have a case which is pictured above, when we want to move chart bar from spot number one to spot number two, where spot number two already have chart bar present on the drop position, is there posibility to validate the drop "on the fly"? Can we have the target information on the before we drop the chart bar on another position? I wanted to lets say change background of the whole xAxis if that validation not pass so user know that he can't drop the bar if there is bar present on drag position...
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: X-range drag and drop validation before dropping chart bar

Hello pfc4ever!

We appreciate you reaching out to us!

There's a drag event, that allows us to drag a bar to another place. But unfortunately, there's no validation functionality here.

In this demo you can see exactly how it works:
https://jsfiddle.net/gh/get/library/pur ... rag-xrange

API references:
https://api.highcharts.com/highcharts/p ... vents.drag

Sadly there are no API options that could meet your expectations. So I suggest getting familiar with the demo above and coding the validation functionality by yourself. :)

Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Usage”