Merge pull request #1898 from GSA/1862-data-visualization-bar-chart-isnt-show-clearly

1862 data visualization bar chart isnt show clearly
This commit is contained in:
Beverly Nguyen
2024-08-27 12:26:47 -07:00
committed by GitHub
5 changed files with 5 additions and 7 deletions

View File

@@ -64,7 +64,7 @@
.padding(0.1);
// Adjust the y-axis domain to add some space above the tallest bar
const maxY = d3.max(deliveredData.map((d, i) => d + (failedData[i] || 0)));
const y = d3.scaleLinear()
const y = d3.scaleSqrt()
.domain([0, maxY + 2]) // Add 2 units of space at the top
.nice()
.range([height, 0]);

View File

@@ -14,7 +14,7 @@
document.getElementById('message').innerText = `${sms_sent.toLocaleString()} sent / ${sms_remaining_messages.toLocaleString()} remaining`;
// Calculate minimum width for "Messages Sent" as 1% of the total chart width
var minSentPercentage = 0.02; // Minimum width as a percentage of total messages (1% in this case)
var minSentPercentage = (sms_sent === 0) ? 0 : 0.02;
var minSentValue = totalMessages * minSentPercentage;
var displaySent = Math.max(sms_sent, minSentValue);
var displayRemaining = totalMessages - displaySent;

View File

@@ -114,7 +114,7 @@
{% endfor %}
{% else %}
<tr class="table-row">
<td class="table-empty-message" colspan="10">No batched job messages found (messages are kept for {{ service_data_retention_days }} days).</td>
<td class="table-empty-message" colspan="10">No messages found</td>
</tr>
{% endif %}
</tbody>

View File

@@ -29,9 +29,7 @@
</div>
<div id="totalMessageTable" class="margin-0"></div>
<h2 class="line-height-sans-2 margin-bottom-0 margin-top-4">
Activity snapshot
</h2>
<h2 class="line-height-sans-2 margin-bottom-0 margin-top-4">Recent activity</h2>
<div id="activityChartContainer">
<form class="usa-form">
<label class="usa-label" for="options">Account</label>

View File

@@ -146,7 +146,7 @@ def test_all_activity_no_jobs(client_request, mocker):
no_jobs_message_td = page.find("td", class_="table-empty-message")
assert no_jobs_message_td is not None, "No jobs message not found in the response"
expected_message = "No batched job messages found (messages are kept for 7 days)."
expected_message = "No messages found"
actual_message = no_jobs_message_td.get_text(strip=True)
assert (