mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 13:37:20 +02:00
Burndown
- Added discussion of the new burndown.bias configuration variable to the NEWS file. - Changed 'major' and 'minor' string names to avoid some clash with gnu_version_major etc. - Added missing include for Linux. - Added new burndown configuration variables to the allowed list.
This commit is contained in:
parent
955634c35b
commit
b581e5d3c4
3 changed files with 26 additions and 22 deletions
2
NEWS
2
NEWS
|
@ -15,6 +15,8 @@ New configuration options in taskwarrior 1.9.4
|
|||
|
||||
- color.burndown.pending, color.burndown.started and color.burndown.done
|
||||
control the color of the burndown charts.
|
||||
- burndown.bias, which is a tweakable control for the completion estimation
|
||||
for the burndown charts, and is documented in taskrc(5).
|
||||
|
||||
Newly deprecated features in taskwarrior 1.9.4
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <Context.h>
|
||||
#include <Date.h>
|
||||
|
@ -52,8 +53,8 @@ public:
|
|||
|
||||
public:
|
||||
int offset; // from left of chart
|
||||
std::string major; // x-axis label, major (year/-/month)
|
||||
std::string minor; // x-axis label, minor (month/week/day)
|
||||
std::string major_label; // x-axis label, major (year/-/month)
|
||||
std::string minor_label; // x-axis label, minor (month/week/day)
|
||||
int pending; // Number of pending tasks in period
|
||||
int started; // Number of started tasks in period
|
||||
int done; // Number of done tasks in period
|
||||
|
@ -64,8 +65,8 @@ public:
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
Bar::Bar ()
|
||||
: offset (0)
|
||||
, major ("")
|
||||
, minor ("")
|
||||
, major_label ("")
|
||||
, minor_label ("")
|
||||
, pending (0)
|
||||
, started (0)
|
||||
, done (0)
|
||||
|
@ -86,8 +87,8 @@ Bar& Bar::operator= (const Bar& other)
|
|||
if (this != &other)
|
||||
{
|
||||
offset = other.offset;
|
||||
major = other.major;
|
||||
minor = other.minor;
|
||||
major_label = other.major_label;
|
||||
minor_label = other.minor_label;
|
||||
pending = other.pending;
|
||||
started = other.started;
|
||||
done = other.done;
|
||||
|
@ -474,7 +475,7 @@ std::string Chart::render ()
|
|||
|
||||
std::sort (bars_in_sequence.begin (), bars_in_sequence.end ());
|
||||
std::vector <time_t>::iterator seq;
|
||||
std::string major;
|
||||
std::string major_label;
|
||||
for (seq = bars_in_sequence.begin (); seq != bars_in_sequence.end (); ++seq)
|
||||
{
|
||||
Bar bar = bars[*seq];
|
||||
|
@ -482,12 +483,12 @@ std::string Chart::render ()
|
|||
// If it fits within the allowed space.
|
||||
if (bar.offset < actual_bars)
|
||||
{
|
||||
grid.replace (LOC (height - 5, max_label + 3 + ((actual_bars - bar.offset - 1) * 3)), bar.minor.length (), bar.minor);
|
||||
grid.replace (LOC (height - 5, max_label + 3 + ((actual_bars - bar.offset - 1) * 3)), bar.minor_label.length (), bar.minor_label);
|
||||
|
||||
if (major != bar.major)
|
||||
grid.replace (LOC (height - 4, max_label + 3 + ((actual_bars - bar.offset - 1) * 3)), bar.major.length (), bar.major);
|
||||
if (major_label != bar.major_label)
|
||||
grid.replace (LOC (height - 4, max_label + 3 + ((actual_bars - bar.offset - 1) * 3)), bar.major_label.length (), bar.major_label);
|
||||
|
||||
major = bar.major;
|
||||
major_label = bar.major_label;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -709,27 +710,27 @@ void Chart::generateBars ()
|
|||
case 'D': // month/day
|
||||
{
|
||||
std::string month = Date::monthName (cursor.month ());
|
||||
bar.major = month.substr (0, 3);
|
||||
bar.major_label = month.substr (0, 3);
|
||||
|
||||
sprintf (str, "%02d", cursor.day ());
|
||||
bar.minor = str;
|
||||
bar.minor_label = str;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'W': // year/week
|
||||
sprintf (str, "%d", cursor.year ());
|
||||
bar.major = str;
|
||||
bar.major_label = str;
|
||||
|
||||
sprintf (str, "%02d", cursor.weekOfYear (0));
|
||||
bar.minor = str;
|
||||
bar.minor_label = str;
|
||||
break;
|
||||
|
||||
case 'M': // year/month
|
||||
sprintf (str, "%d", cursor.year ());
|
||||
bar.major = str;
|
||||
bar.major_label = str;
|
||||
|
||||
sprintf (str, "%02d", cursor.month ());
|
||||
bar.minor = str;
|
||||
bar.minor_label = str;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -891,11 +891,12 @@ int handleShow (std::string& outs)
|
|||
// Note that there is a leading and trailing space, to make it easier to
|
||||
// search for whole words.
|
||||
std::string recognized =
|
||||
" annotations blanklines bulk calendar.details calendar.details.report "
|
||||
"calendar.holidays calendar.legend color color.active color.due "
|
||||
"color.due.today color.blocked color.overdue color.pri.H color.pri.L "
|
||||
"color.pri.M color.pri.none color.recurring color.tagged color.footnote "
|
||||
"color.header color.debug color.alternate color.calendar.today "
|
||||
" annotations blanklines bulk burndown.bias calendar.details "
|
||||
"calendar.details.report calendar.holidays calendar.legend color "
|
||||
"color.active color.due color.due.today color.blocked color.burndown.done "
|
||||
"color.burndown.pending color.burndown.started color.overdue color.pri.H "
|
||||
"color.pri.L color.pri.M color.pri.none color.recurring color.tagged "
|
||||
"color.footnote color.header color.debug color.alternate color.calendar.today "
|
||||
"color.calendar.due color.calendar.due.today color.calendar.overdue "
|
||||
"color.calendar.weekend color.calendar.holiday color.calendar.weeknumber "
|
||||
"color.summary.background color.summary.bar color.history.add "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue