From 1d7589abb96036f8f511c2959d5be498d1c862e0 Mon Sep 17 00:00:00 2001 From: Tyler Long Date: Tue, 6 Mar 2018 18:41:06 +0800 Subject: [PATCH] Try to fix gantt diagram --- src/diagrams/gantt/ganttRenderer.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/diagrams/gantt/ganttRenderer.js b/src/diagrams/gantt/ganttRenderer.js index 5bbe67a10..e3072c096 100644 --- a/src/diagrams/gantt/ganttRenderer.js +++ b/src/diagrams/gantt/ganttRenderer.js @@ -60,7 +60,7 @@ export const draw = function (text, id) { }) // Set timescale - const timeScale = d3.time.scale() + const timeScale = d3.scaleTime() .domain([d3.min(taskArray, function (d) { return d.startTime }), @@ -98,7 +98,7 @@ export const draw = function (text, id) { const topPadding = conf.topPadding const leftPadding = conf.leftPadding - const colorScale = d3.scale.linear() + const colorScale = d3.scaleLinear() .domain([0, categories.length]) .range(['#00B9FA', '#F95002']) .interpolate(d3.interpolateHcl) @@ -300,20 +300,20 @@ export const draw = function (text, id) { } formatter = pre.concat(mid).concat(post) - let xAxis = d3.svg.axis() - .scale(timeScale) - .orient('bottom') - .tickSize(-h + theTopPad + conf.gridLineStartPadding, 0, 0) - .tickFormat(d3.time.format.multi(formatter)) + // let xAxis = d3.svg.axis() + // .scale(timeScale) + // .orient('bottom') + // .tickSize(-h + theTopPad + conf.gridLineStartPadding, 0, 0) + // .tickFormat(d3.time.format.multi(formatter)) - if (daysInChart > 7 && daysInChart < 230) { - xAxis = xAxis.ticks(d3.time.monday.range) - } + // if (daysInChart > 7 && daysInChart < 230) { + // xAxis = xAxis.ticks(d3.timeMonday.range) + // } svg.append('g') .attr('class', 'grid') .attr('transform', 'translate(' + theSidePad + ', ' + (h - 50) + ')') - .call(xAxis) + // .call(xAxis) // todo: fix this instead of commentting out .selectAll('text') .style('text-anchor', 'middle') .attr('fill', '#000')