当前位置: 首页 > article >正文

react 甘特图之旅

  1. react-gantt
    GitHub 仓库: https://github.com/clayrisser/react-gantt

  2. react-gantt-chart
    GitHub 仓库: https://github.com/MaTeMaTuK/gantt-task-react

  3. easy-gant-beta
    GitHub 仓库: https://github.com/web-widgets/react-gantt-demos

上面的版本不兼容

  1. dhtmlx-gantt
    官方网站: https://docs.dhtmlx.com/gantt/
    GitHub 仓库: https://github.com/dhtmlx/dhtmlx-gantt

试用版
npm install @dhx/trial-gantt 安装不了

npm install dhtmlx-gantt 标准版(免费)
可以参考:https://dhtmlx.com/blog/create-react-gantt-chart-component-dhtmlxgantt/
安装

 npm install @bryntum/gantt-trial    

5、 syncfusion/ej2-react-gantt 收费, 30天免费试用
syncfusion/ej2-react-gantt

npm install @syncfusion/ej2-react-gantt
npm list @syncfusion/ej2-buttons @syncfusion/ej2-base

6、kendo-react-ui 收费
kendo-react-ui

npm install @progress/kendo-react-gantt 
 
npm install @progress/kendo-react-common
npm install @progress/kendo-react-grid 

综上,我推荐dhtmlx-gantt 免费版,

在这里插入图片描述

import React, { useEffect, useRef } from 'react';
import { gantt } from 'dhtmlx-gantt';
import 'dhtmlx-gantt/codebase/dhtmlxgantt.css';
 


const Dhtmlx = () => {
  const container = useRef<HTMLDivElement>(null);

  const data = {
    data: [
      { id: 1, text: "Project #1", start_date: null, duration: null, parent: 0, progress: 0, open: true },
      { id: 2, text: "Task #1", start_date: "2024-08-01 00:00", duration: 1, parent: 1, progress: 1 },
      { id: 3, text: "Task #2", start_date: "2024-08-06 00:00", duration: 2, parent: 1, progress: 0.5 },
      { id: 4, text: "Task #3", start_date: null, duration: null, parent: 1, progress: 0.8, open: true },
      { id: 5, text: "Task #3.1", start_date: "2024-08-09 00:00", duration: 2, parent: 4, progress: 0.2 },
      { id: 6, text: "Task #3.2", start_date: "2024-08-11 00:00", duration: 1, parent: 4, progress: 0 }
    ],
    links: [
      { id: 1, source: 2, target: 3, type: "0" },
      { id: 2, source: 3, target: 4, type: "0" },
      { id: 3, source: 5, target: 6, type: "0" }
    ]

  };

  useEffect(() => {
    if (container.current) {
      gantt.config.date_format = "%Y-%m-%d %H:%i";
      gantt.init(container.current);
      gantt.parse(data);
    }

    return () => {
      gantt.clearAll();
    };
  }, []);
  return (
    <div>
      <div ref={container} style={{ width: '100%', height: '500px' }}></div>
    </div>
  )

}

export default Dhtmlx 
 

http://www.kler.cn/news/312219.html

相关文章:

  • C语言 | Leetcode C语言题解之第405题数字转换为十六进制数
  • SpringBoot 数据库表结构文档生成
  • 深入Redis:核心的缓存
  • 【计算机网络 - 基础问题】每日 3 题(十四)
  • 百易云资产系统 house.save.php SQL注入
  • tomcat知识
  • 【Android】ViewPager
  • 生信初学者教程(三):介绍
  • [Linux] 进程优先级 进程的调度与切换 环境变量详解
  • qt--Qml控件库如何从外部导入
  • 虾皮选品技巧有哪些?超全Shopee选品的方法和技巧分享!
  • C#无标题栏窗体拖动
  • 物联网开发+充电桩管理系统+充电桩系统源码
  • 【北京迅为】《STM32MP157开发板使用手册》- 第四十二章 事件实验
  • Java设计模式—面向对象设计原则(四) ----->接口隔离原则(ISP) (完整详解,附有代码+案例)
  • 基于JavaWeb开发的java+Springboot操作系统教学交流平台详细设计实现
  • 探索AI大模型的未来:电信运营商与云服务商的新征途@附58页PDF文件下载
  • liunx 计划任务
  • VRRP协议原理
  • 《计算机网络名词解释》
  • 【Python报错已解决】ModuleNotFoundError: No module named ‘paddle‘
  • 量化交易软件、接口、API、区别、用法,有什么好用的么
  • Vue2中路由的介绍和使用
  • UDS诊断-面试题2
  • 掌握Protobuf精髓:深入解析.proto文件语法及高效应用
  • 蓝桥杯4. Fizz Buzz 经典问题
  • sql基础语法及常见函数等
  • 解决:The play() request was interrupted by a call to pause().报错
  • Android Glide:让图片加载从未如此简单
  • 14_input子系统my_touch_device,my_touch_handlerLinux内核模块