window size 7 days
This commit is contained in:
@@ -53,7 +53,10 @@ const TestAnalytics = () => {
|
||||
const dailyCountsList = Object.entries(dailyCounts).sort().map(x => {
|
||||
return { date: x[0], count: x[1] };
|
||||
});
|
||||
setDailyResults(dailyCountsList);
|
||||
if (dailyCountsList?.length > 7)
|
||||
setDailyResults(dailyCountsList.slice(dailyCountsList.length - 7, dailyCountsList.length));
|
||||
else
|
||||
setDailyResults(dailyCountsList);
|
||||
const rss = _.groupBy(hposTests, function (test) {
|
||||
return moment(test.testTime).startOf('day').format();
|
||||
});
|
||||
|
||||
@@ -68,8 +68,8 @@ div#tests-count-graph {
|
||||
}
|
||||
|
||||
svg#bargraph {
|
||||
height: 180px; /* 500px; */
|
||||
width: 700px; /* 1100px; */
|
||||
height: 160px; /* 500px; */
|
||||
width: 400px; /* 1100px; */
|
||||
/* border: 1px dotted #ccc; */
|
||||
/* background-color: #ccc; */
|
||||
}
|
||||
@@ -23,10 +23,10 @@ class TestAnalyticsGraph extends Component {
|
||||
drawBar(data) {
|
||||
if (!data) return;
|
||||
|
||||
data.reverse();
|
||||
// data.reverse();
|
||||
|
||||
var margin = { top: 30, right: 20, bottom: 50, left: 15 },
|
||||
width = 900 - margin.left - margin.right,
|
||||
var margin = { top: 30, right: 20, bottom: 50, left: 55 },
|
||||
width = 400 - margin.left - margin.right,
|
||||
height = 180 - margin.top - margin.bottom;
|
||||
|
||||
var svg = d3.select("#tests-count-graph").append('svg')
|
||||
|
||||
Reference in New Issue
Block a user