stuartdotnet
Posts: 1
Joined: Thu Apr 28, 2022 11:58 pm

When dragging an item in the Gantt chart, the scale changes until dropped

I have a gantt chart with the following configuration. If it is more than 1 year on the x scale, when i pick up an item, the scale goes to 1 year. When I drop it, the scale snaps back to the correct, greater than 1 year scale.

How can I force it to maintain its scale when dragging?

Code: Select all

day = 1000 * 60 * 60 * 24;

return {
      credits: false,
      plotOptions: {
        series: {
          animation: false,
          dragDrop: {
            draggableX: true,
            draggableY: false,
            dragPrecisionX: this.day
          },
          dataLabels: {
            enabled: true,
            format: '{point.name}',
            style: {
              cursor: 'default',
              pointerEvents: 'none'
            }
          },
          allowPointSelect: true
        }
      },
      xAxis: [{
          min: Date.parse(this.$props.designStart),
          max: Date.parse(this.$props.designEnd),
          zoomEnabled: false,
          minRange: this.day * 365,
          minTickInterval: this.day
      }, { visible: true }],
      navigator: {
          enabled: true,
          liveRedraw: true,
          series: {
            type: 'gantt',
            pointPlacement: 0.5,
            pointPadding: 0.25
          },
          yAxis: {
            min: 0,
            max: 3,
            reversed: true,
            categories: []
          }
      },
      scrollbar: {
        enabled: false
      },
      rangeSelector: {
        enabled: false
      },
      series: [{
        data: this.getSeries()
      }]
    }
  }
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: When dragging an item in the Gantt chart, the scale changes until dropped

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

It is hard to tell you what is not working and what could be done without taking look at your code and examples of your data.

Could you create a live demo showing the issue? You can start here: https://jsfiddle.net/BlackLabel/b61k5yfp/

If you pull data from somewhere else, you don't need to use it in the demo, the data can be hardcoded, but similiar to yours.

Best regards!
Hubert Kozik
Highcharts Developer
[email protected]
Posts: 65
Joined: Fri Aug 26, 2022 9:33 am

Re: When dragging an item in the Gantt chart, the scale changes until dropped

Hello,
Do you know how we can get the changes after drag?

Thanks in advance
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: When dragging an item in the Gantt chart, the scale changes until dropped

Hi there!

Please, do not duplicate posts on our forum and wait for the reply on your topic. That makes it much easier to track the whole issue in one topic (for us, and future users who might face a similar issue). I have answered your question here on your topic: viewtopic.php?f=19&t=49358

Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Gantt”