没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
翻译|使用教程|编辑:秦林|2022-09-23 09:57:22.800|阅读 153 次
概述:本篇文章继续给大家讲解如何初始化dhtmlxGantt。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
相关链接:
将 dhtmlxGantt 文件导入基于 React 的应用程序的示例:
import React, { Component } from 'react'; import { gantt } from 'dhtmlx-gantt'; import 'dhtmlx-gantt/codebase/dhtmlxgantt.css'; export default class Gantt extends Component { componentDidUpdate() { gantt.render(); } componentDidMount() { gantt.init(this.ganttContainer); gantt.parse(this.props.tasks); } render() { return ( <div ref={(input) => { this.ganttContainer = input }} style=width: '100%', height: '100%' ></div> ); } }
将 dhtmlxGantt文件导入基于 Angular 的应用程序的示例:
import {Component,ElementRef,OnInit,ViewChild,ViewEncapsulation} from '@angular/core'; import {TaskService} from '../services/task.service'; import {LinkService} from '../services/link.service'; import {Task} from '../models/task'; import {Link} from '../models/link'; import { gantt, Gantt } from 'dhtmlx-gantt'; @Component({ encapsulation: ViewEncapsulation.None, selector: 'gantt', styleUrls: ['./gantt.component.css'], providers: [TaskService, LinkService], template: `<div #gantt_here class='gantt-chart'></div>`, }) export class GanttComponent implements OnInit { @ViewChild('gantt_here') ganttContainer: ElementRef; constructor(private taskService:TaskService, private linkService:LinkService){ } ngOnInit() { gantt.config.xml_date = '%Y-%m-%d %H:%i'; gantt.init(this.ganttContainer.nativeElement); Promise.all([this.taskService.get(), this.linkService.get()]) .then(([data, links]) => { gantt.parse({ data, links }); }); } }
要将 dhtmlxGantt 文件包含到基于 RequireJS 的应用程序中,您需要遵循以下示例中显示的逻辑:
requirejs(["codebase/dhtmlxgantt"], function(dhx){ var gantt = dhx.gantt; var Gantt = dhx.Gantt;// for Enterprise builds gantt.init("gantt_here"); gantt.parse({ data: [ { id:1, text:"Project #2", start_date:"01-04-2018", duration:18, progress:0.4, open:true }, { id:2, text:"Task #1", start_date:"02-04-2018", duration:8, progress:0.6, parent:1 }, { id:3, text:"Task #2", start_date:"11-04-2018", duration:8, progress:0.6, parent:1 } ], links: [ { id:1, source:1, target:2, type:"1" }, { id:2, source:2, target:3, type:"0" } ] }); });
dhtmlxGantt 库将返回一个带有字段的对象 gantt和 Gantt(在 Commercial、Enterprise 或 Ultimate 版本中)-甘特和甘特图对象此处 。
下面的示例演示了如何以 custom_tooltip_plugin.js 正确的方式设置:
requirejs.config({ paths: { "dhtmlxgantt": "../../codebase/dhtmlxgantt", "ext/dhtmlxgantt_custom_tooltip": "../custom_tooltip_plugin" }, shim: { "ext/dhtmlxgantt_custom_tooltip": ["dhtmlxgantt"] } }); requirejs(["dhtmlxgantt"], function (dhx) { var gantt = dhx.gantt; var date_to_str = gantt.date.date_to_str(gantt.config.task_date); var today = new Date(2018, 3, 5); gantt.addMarker({ start_date: today, css: "today", text: "Today", title: "Today: " + date_to_str(today) }); gantt.init("gantt_here"); gantt.parse({ data: [ { id:1, text:"Project #2", start_date:"01-04-2018", duration:18, progress:0.4, open:true }, { id:2, text:"Task #1", start_date:"02-04-2018", duration:8, progress:0.6, parent:1 }, { id:3, text:"Task #2", start_date:"11-04-2018", duration:8, progress:0.6, parent:1 } ], links: [ { id:1, source:1, target:2, type:"1" }, { id:2, source:2, target:3, type:"0" } ] }); });
检查包内任何文件的模块名称是否指定为包 的“代码库”文件夹内的相对路径加上 文件名 ,例如:
核心库:
要在不同的浏览器中以全屏模式正确显示甘特图,请在页面上定义以下样式:
<style type="text/css" media="screen"> html, body{ margin:0px; padding:0px; height:100%; overflow:hidden; } </style>
dhtmlxGantt是用于跨浏览器和跨平台应用程序的功能齐全的Gantt图表,可满足项目管理控件应用程序的所有需求,是最完善的甘特图图表库。了解更多DhtmlxGantt相关内容和资讯,欢迎在线咨询或者私信我获取正版试用版及报价。
甘特图控件交流群:764148812 欢迎进群交流讨论
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@wqylolg.cn
通过编程方式管理和操作 Excel 文件已成为开发者的必备技能。Spire.XLS for .NET 正是这样一款多功能且强大的库,它能让您使用 C# 无缝地创建、读取、写入和编辑 Excel 文件。
空白单元格可能会导致 Excel 报告和分析出现问题。过滤空白单元格有助于清理和整理数据,从而获得更佳结果。本文将指导您使用 C# 过滤空白和非空白单元格。
ONLYOFFICE 表单可以轻松收集结构化输入,但空的、非必填字段经常会被忽略。在本篇博文中,我们将演示如何构建一个宏,用于突出显示表单中所有空的、非必填字段,或者仅突出显示包含特定提示文本的字段。
CST CAD Navigator 是一款功能强大、兼容性高的 CAD 图纸查看工具,由 CADSoftTools开发,能在 Windows、macOS 和 Linux 系统上稳定运行。它拥有简洁直观的操作界面,却内置强大内核,能实现对 2D 图纸和 3D 模型的快速查看。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@wqylolg.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢