mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Bug
- The burndown chart was reserving space for the y-axis labels based on the maximum value in the data. This is wrong. Instead it should have used the maximum *label*. Consider a graph with a maximum value of 99, having a width of 2 characters. The graph labels should go up to 100, not 99, and therefore will take up 3 characters.
This commit is contained in:
parent
8d720cacc5
commit
5f007ed1d9
1 changed files with 5 additions and 4 deletions
|
@ -447,13 +447,14 @@ std::string Chart::render ()
|
||||||
grid.replace (LOC (graph_height / 2, width - 10), 10, "ss Started");
|
grid.replace (LOC (graph_height / 2, width - 10), 10, "ss Started");
|
||||||
grid.replace (LOC (graph_height / 2 + 1, width - 10), 10, "pp Pending");
|
grid.replace (LOC (graph_height / 2 + 1, width - 10), 10, "pp Pending");
|
||||||
|
|
||||||
// Draw y-axis.
|
|
||||||
for (int i = 0; i < graph_height; ++i)
|
|
||||||
grid.replace (LOC (i + 1, max_label + 1), 1, "|");
|
|
||||||
|
|
||||||
// Determine y-axis labelling.
|
// Determine y-axis labelling.
|
||||||
std::vector <int> labels;
|
std::vector <int> labels;
|
||||||
yLabels (labels);
|
yLabels (labels);
|
||||||
|
max_label = (int) log10 ((double) labels[2]) + 1;
|
||||||
|
|
||||||
|
// Draw y-axis.
|
||||||
|
for (int i = 0; i < graph_height; ++i)
|
||||||
|
grid.replace (LOC (i + 1, max_label + 1), 1, "|");
|
||||||
|
|
||||||
// Draw y-axis labels.
|
// Draw y-axis labels.
|
||||||
char label [12];
|
char label [12];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue