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:
@@ -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 + 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.
|
||||
std::vector <int> 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.
|
||||
char label [12];
|
||||
|
||||
Reference in New Issue
Block a user