From 92e8da44355e272ee78801a1687a45001cd998a2 Mon Sep 17 00:00:00 2001 From: huyuanming Date: Wed, 22 May 2019 15:02:54 +0800 Subject: [PATCH] gantt --- .../projects/pages/instance/pages/gantt/_source/gantt.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/escheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/_source/gantt.js b/escheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/_source/gantt.js index f105eb96f1..482a395fa1 100644 --- a/escheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/_source/gantt.js +++ b/escheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/_source/gantt.js @@ -107,11 +107,11 @@ Gantt.prototype.drawChart = function () { .append('svg') .attr('class', 'chart') .attr('width', this.width + this.margin.left + this.margin.right) - .attr('height', this.height + this.margin.top + this.margin.bottom) + .attr('height', this.height + this.margin.top + this.margin.bottom + 150) .append('g') .attr('class', 'gantt-chart') .attr('width', this.width + this.margin.left + this.margin.right) - .attr('height', this.height + this.margin.top + this.margin.bottom) + .attr('height', this.height + this.margin.top + this.margin.bottom + 150) .attr('transform', 'translate(' + this.margin.left + ', ' + this.margin.top + ')') svg.selectAll('.chart') @@ -132,6 +132,9 @@ Gantt.prototype.drawChart = function () { .attr('transform', 'translate(0, ' + (this.height - this.margin.top - this.margin.bottom) + ')') .transition() .call(this.xAxis) + .selectAll("text") + .attr("transform", `rotate(-${this.width / ($('.tick').length - 1) > 50 ? 0 : Math.acos(this.width / ($('.tick').length - 1) / 50) * 57 })`) + .style("text-anchor", `${this.width / ($('.tick').length - 1) > 50 ? 'middle' : 'end'}`) svg.append('g') .attr('class', 'y axis')