ZoomToFit Programmatically Gantt Chart not working correctly

Hi,

I am facing an issue when calling fitToProject() that changes the style of the activities in the timeline.


The "Adatta zoom" (ZoomToFit) button built in the component works correctly as you can see in the screenshot.


 When calling the method from a custom button the activies are shown like this:



I am using Syncfusion version 20.2.38.

Are you also facing this issue? Is there a solution?

Thank you in advanced.


Best regards,

Matteo Messmer


3 Replies 1 reply marked as answer

MS Monisha Sivanthilingam Syncfusion Team September 6, 2022 09:30 AM UTC

Hi Matteo,


Greetings from Syncfusion support.


We were unable to replicate the issue you have reported. We checked with the version you have reported, (i.e.), v20.2.38 and the latest version v20.2.46. However, in both cases the issue was not replicated. Please share more details about your issue, such as:


  1. The steps to replicate your issue.
  2. A video demonstration of your issue.
  3. If possible, please share an issue reproducible sample or modify the below sample to replicate your issue.


Sample: https://stackblitz.com/edit/react-nkahuz?file=index.js


Regards,

Monisha.



MA matteomessmer September 6, 2022 01:55 PM UTC

Hi Monisha,

thank you, just found the issue when trying to replicate it.

The issue is that I am using queryTaskbarInfo for the color (exactly as in the sample), but I'm also using parentTaskbarTemplate and taskbarTemplate to show the labels. I didn't know about the labelSettings property until I saw it in your sample. 

I solved by using the labelSettings and removing the taskbarTemplate. 

On a side note, I am not sure if setting the color with queryTaskbarInfo and the labels with tasbarTemplate is supposed to work, but in my case it did.

Best regards,

Matteo



MS Monisha Sivanthilingam Syncfusion Team September 7, 2022 06:00 AM UTC

Hi Matteo,


You are welcome.


We are glad that you were able to resolve your issue.


Yes, we can use the queryTaskbarInfo event to set the color of the tasks and also use the task bar template to set the labels. This approach also works. However, we also have direct support to render labels for the tasks. To display some of the direct properties please use the label settings available in Gantt Chart.


Online Documentation: https://ej2.syncfusion.com/react/documentation/gantt/appearance-customization/#task-labels


Please contact us if you require any further assistance.


Regards,

Monisha.


Marked as answer
Loader.
Up arrow icon