mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 00:40:22 +02:00
gantt: only display topAxis if configured or directive is set
This commit is contained in:
@@ -371,21 +371,23 @@ export const draw = function(text, id) {
|
|||||||
.attr('font-size', 10)
|
.attr('font-size', 10)
|
||||||
.attr('dy', '1em');
|
.attr('dy', '1em');
|
||||||
|
|
||||||
let topXAxis = axisTop(timeScale)
|
if (ganttDb.topAxisEnabled() || conf.topAxis) {
|
||||||
.tickSize(-h + theTopPad + conf.gridLineStartPadding)
|
let topXAxis = axisTop(timeScale)
|
||||||
.tickFormat(timeFormat(parser.yy.getAxisFormat() || conf.axisFormat || '%Y-%m-%d'));
|
.tickSize(-h + theTopPad + conf.gridLineStartPadding)
|
||||||
|
.tickFormat(timeFormat(parser.yy.getAxisFormat() || conf.axisFormat || '%Y-%m-%d'));
|
||||||
|
|
||||||
svg
|
svg
|
||||||
.append('g')
|
.append('g')
|
||||||
.attr('class', 'grid')
|
.attr('class', 'grid')
|
||||||
.attr('transform', 'translate(' + theSidePad + ', ' + (h - 50) + ')')
|
.attr('transform', 'translate(' + theSidePad + ', ' + (h - 50) + ')')
|
||||||
.call(topXAxis)
|
.call(topXAxis)
|
||||||
.selectAll('text')
|
.selectAll('text')
|
||||||
.style('text-anchor', 'middle')
|
.style('text-anchor', 'middle')
|
||||||
.attr('fill', '#000')
|
.attr('fill', '#000')
|
||||||
.attr('stroke', 'none')
|
.attr('stroke', 'none')
|
||||||
.attr('font-size', 10)
|
.attr('font-size', 10)
|
||||||
.attr('dy', '1em');
|
.attr('dy', '1em');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function vertLabels(theGap, theTopPad) {
|
function vertLabels(theGap, theTopPad) {
|
||||||
|
Reference in New Issue
Block a user