Hello Jinhua,
Probably, it happens because the only task in the chart doesn’t have the necessary date parameters.
Each regular task should have at least 2 date parameters: start_date
, end_date
, duration
. When a regular task doesn’t have those parameters, it should be unscheduled:
https://docs.dhtmlx.com/gantt/desktop__unscheduled_tasks.html
Project tasks ignore the date parameters, so they can be loaded without those parameters:
http://snippet.dhtmlx.com/dd3973ee5
However, it is possible to load tasks without dates. In that case, the dateless tasks will obtain the date parameters from their children or from other tasks.
But those tasks cannot be the first one that you load:
http://snippet.dhtmlx.com/05ced85c4
http://snippet.dhtmlx.com/bc8fdfc9f
If you want to have something like projects, you can assign any date in the onTaskLoading
event handler. After adding children, you will be able to see the task, and after you drag or resize children, the parent task will be resized:
http://snippet.dhtmlx.com/a0e68e798
Another possible reason for the error message is the wrong date format:
https://docs.dhtmlx.com/gantt/api__gantt_date_format_config.html
However, there might be other reasons why you get that error message, but it is hard to suggest what might be wrong as I don’t see your code. If the tips above don’t help you, please, reproduce the issue in the snippet, then click on the “Share” button and send me the link:
https://snippet.dhtmlx.com/38ee1b370
Or send me an HTML file with all the necessary Javascript and CSS files.