fix dounut chart tooltip

- add constants
	- add container row in analytics page to reduce scroll
This commit is contained in:
Pritimay Sarkar
2023-07-31 17:24:07 +05:30
parent af54d53f8f
commit fb602e56d7
8 changed files with 53 additions and 22 deletions

View File

@@ -21,8 +21,8 @@ class TestAnalyticsGraph extends Component {
data.reverse();
var margin = { top: 20, right: 20, bottom: 30, left: 50 },
width = 900 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
width = 450 - margin.left - margin.right,
height = 200 - margin.top - margin.bottom;
var svg = d3.select("#tests-count-graph").append('svg')
.attr("width", width + margin.left + margin.right)
@@ -38,7 +38,7 @@ class TestAnalyticsGraph extends Component {
.attr("transform", "translate(" + 10 + "," + 10 + ")");
xScale.domain(data.map(function (d) { return d.date; }));
xScale.domain(data.map(function (d) { return moment(d.date).format("MM-DD"); }));
yScale.domain([0, d3.max(data, function (d) { return d.count; })]);
@@ -72,7 +72,7 @@ class TestAnalyticsGraph extends Component {
g.append("text")
.attr('class', 'val') // add class to text label
.attr('x', function () {
return xScale(d.date);
return xScale(moment(d.date).format("MM-DD"));
})
.attr('y', function () {
return yScale(d.count) - 15;
@@ -93,7 +93,7 @@ class TestAnalyticsGraph extends Component {
d3.selectAll('.val')
.remove()
})
.attr("x", function (d) { return xScale(d.date); })
.attr("x", function (d) { return xScale(moment(d.date).format("MM-DD")); })
.attr("y", function (d) { return yScale(d.count); })
.attr("width", xScale.bandwidth())
.transition()