Support customization of gantt diagram xAxis format using diagram code

This commit is contained in:
Tyler Long
2018-03-13 14:01:44 +08:00
parent 7ef1b28c83
commit f62736c749
6 changed files with 34 additions and 17 deletions

View File

@@ -244,7 +244,7 @@ export const draw = function (text, id) {
function makeGrid (theSidePad, theTopPad, w, h) {
let xAxis = d3.axisBottom(timeScale)
.tickSize(-h + theTopPad + conf.gridLineStartPadding)
.tickFormat(d3.timeFormat(conf.axisFormat || '%Y-%m-%d'))
.tickFormat(d3.timeFormat(parser.yy.getAxisFormat() || conf.axisFormat || '%Y-%m-%d'))
svg.append('g')
.attr('class', 'grid')