用途:为 ApexGantt 甘特图/时间线图表提供 AI 编码技能,覆盖创建、配置、渲染、更新与排错。生成代码前先检查 package.json:react 用 react-apexgantt,vue 用 vue-apexgantt,@angular/core 用 ngx-apexgantt;无框架时可用核心 API。
主要能力:series 为必填任务数组,每项含 id、name、startTime,通常含 endTime;支持 progress(0–100)、type: 'milestone'(省略 endTime)、parentId 层级、dependency、baseline、segments 拆分任务及按任务的行/条背景色。依赖支持字符串(FS,lag 0)或 { taskId, type, lag },type 为 FS/SS/FF/SF。
使用方式:const gantt = new ApexGantt(el, { series: [...] }),必须随后调用 gantt.render()。日期字符串需匹配 inputDateFormat(默认 'MM-DD-YYYY',ISO 需设为 'YYYY-MM-DD')。用 update() 整体重配,updateTask(id, patch) 单任务更新;卸载前必须 gantt.destroy()。事件在容器元素上触发,用 container.addEventListener(GanttEvents.TASK_UPDATE_SUCCESS, …)。选择功能需 enableSelection: true。
常用选项:theme、pixelsPerDay、snapUnit/snapValue、calendar、history、columnConfig、sortBy、filterBy/filterRules、groupBy、拖拽/缩放/编辑开关、enableCriticalPath、enableRollups、exportFormat、toolbarItems、parsing、annotations 等;主题可用 --apx-* CSS 变量,但不支持主题名注册表。
限制:id 必须唯一稳定,parentId 必须指向已存在任务,否则静默丢弃;progress 超范围会被截断;里程碑不要传 endTime。其余未提供。