gantt-task-react icon indicating copy to clipboard operation
gantt-task-react copied to clipboard

Change the barBackgroundColor based on condition

Open suniltayal opened this issue 2 years ago • 1 comments

Hi @maberalc @MaTeMaTuK @Janlaywss @hexagonatron @VikariiCGI

I want to change the barBackgroundColor based on condition. Inline is allowing me to pass only progressColor and progressSelectedColor styles: { progressColor: '#ffbb54', progressSelectedColor: '#ff9e0d' }

image

Please let me know how I can set individual bar background color differently?

Thank you, Sunil

suniltayal avatar Jul 18 '22 09:07 suniltayal

The task allows for the background color to be set in the styles for the task https://github.com/MaTeMaTuK/gantt-task-react#task

    {
      start: new Date(currentDate.getFullYear(), currentDate.getMonth(), 1),
      end: new Date(currentDate.getFullYear(), currentDate.getMonth(), 1,4),
      name: "Research",
      id: "Task 1",
      progress: 25,
      dependencies: ["Task 0"],
      type: "task",
      styles: {
        backgroundColor: '#FF0000'
      },
      project: "ProjectSample",
      displayOrder: 3,
    },

Graeme43 avatar Aug 21 '22 11:08 Graeme43