diff --git a/src/diagrams/gantt/ganttDb.js b/src/diagrams/gantt/ganttDb.js index d64498374..8fd100e0c 100644 --- a/src/diagrams/gantt/ganttDb.js +++ b/src/diagrams/gantt/ganttDb.js @@ -16,6 +16,7 @@ let currentSection = ''; const tags = ['active', 'done', 'crit', 'milestone']; let funs = []; let inclusiveEndDates = false; +let topAxis = false; // The serial order of the task in the script let lastOrder = 0; @@ -39,6 +40,7 @@ export const clear = function() { todayMarker = ''; excludes = []; inclusiveEndDates = false; + topAxis = false; lastOrder = 0; }; @@ -70,6 +72,14 @@ export const endDatesAreInclusive = function() { return inclusiveEndDates; }; +export const enableTopAxis = function() { + topAxis = true; +}; + +export const topAxisEnabled = function() { + return topAxis; +}; + export const getDateFormat = function() { return dateFormat; }; @@ -594,6 +604,8 @@ export default { getDateFormat, enableInclusiveEndDates, endDatesAreInclusive, + enableTopAxis, + topAxisEnabled, setAxisFormat, getAxisFormat, setTodayMarker, diff --git a/src/diagrams/gantt/parser/gantt.jison b/src/diagrams/gantt/parser/gantt.jison index f63e367ef..f5746a32f 100644 --- a/src/diagrams/gantt/parser/gantt.jison +++ b/src/diagrams/gantt/parser/gantt.jison @@ -68,6 +68,7 @@ that id. "gantt" return 'gantt'; "dateFormat"\s[^#\n;]+ return 'dateFormat'; "inclusiveEndDates" return 'inclusiveEndDates'; +"topAxis" return 'topAxis'; "axisFormat"\s[^#\n;]+ return 'axisFormat'; "excludes"\s[^#\n;]+ return 'excludes'; "todayMarker"\s[^\n;]+ return 'todayMarker'; @@ -108,6 +109,7 @@ line statement : dateFormat {yy.setDateFormat($1.substr(11));$$=$1.substr(11);} | inclusiveEndDates {yy.enableInclusiveEndDates();$$=$1.substr(18);} + | topAxis {yy.TopAxis();$$=$1.substr(8);} | axisFormat {yy.setAxisFormat($1.substr(11));$$=$1.substr(11);} | excludes {yy.setExcludes($1.substr(9));$$=$1.substr(9);} | todayMarker {yy.setTodayMarker($1.substr(12));$$=$1.substr(12);}