If there is a need to add a label to task, you need to define label using the appropriate field (
'actual' or 'baseline'), it depends on where exactly do you want to put the text. You can also define font settings, position of anchor relative to the task bar and alignment relative to binding anchor using
base label text settings.
Sample shows how to define label in
AnyGantt JS Project Gantt Chart.