讲讲甘特图的一些控件怎么用

这条线 --->

 那么你需要在你的数据里面有 links 这个属性 这个属性里面 id参数就是正常的id, source : 是连接谁 ; target: 是要和谁连  (里面写data里面的id) ;

旁边列的标题------->

 首先需要把   gantt.config.reorder_grid_columns 设置为true 然后  gantt.config.columns 里面写你的标题内容,这是一个数组;label是列显示的名字 ,width是宽度,这个列自带滚动条的,align是对齐的方式,resize是缩放的意思(可以参考下面的代码)

 gantt.config.reorder_grid_columns = true;
            gantt.config.columns = [{
                name: "text",
                label: "任务名",
                width: 200,
                align: "center",
                tree: true,
                resize: true
            }, {
                name: "start_date",
                label: "开始日期",
                width: 100,
                align: "center",
                resize: true
            }, {
                name: "duration",
                label: "持续时间",
                width: 100,
                align: "center",
                resize: true

            }];

提示工具信息----->

  gantt.templates.tooltip_text 这个函数 (参考下面的代码):

  gantt.templates.tooltip_text = function (start, end, task) {
                return "<b>订单:</b> " + task.text + "<br/><b>开始时间:</b> " + gantt.templates.tooltip_date_format(start) + "<br/><b>结束时间:</b> " + gantt.templates.tooltip_date_format(end);
            };

 进度条:function percenToString (参考代码)

  function percenToString(num) {
                return Math.floor(num * 100) + '%';
            }

后面我编不出来了,代码都在上一篇博客里了,意思大概就是那么个意思,直接抄回去了慢慢改,觉得真香的给我点个赞,kkkkk!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值