Skip to content

Commit 1ca22a8

Browse files
authored
[A11y]Fix Graph on stats for narrow screen. (#9028)
* Testing new chart title. * Remove dead lines.
1 parent 1b69335 commit 1ca22a8

2 files changed

Lines changed: 7 additions & 23 deletions

File tree

src/NuGetGallery/Scripts/gallery/stats-perpackagestatsgraphs.js

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,6 @@
113113
.attr("height", function (d) { return height - yScale(d.downloads); })
114114
.append("title").text(function (d) { return d.downloads + " Downloads"; });
115115

116-
svg.append("foreignObject")
117-
.attr("x", "1.71em")
118-
.attr("y", -30)
119-
.attr("width", width - 20 + "px")
120-
.attr("height", "2em")
121-
.attr("font-weight", "bold")
122-
.append("xhtml:body")
123-
.append("p")
124-
.attr("style", "text-align:center")
125-
.text("Downloads for 15 Latest Package Versions (Last 6 weeks)");
126-
127116
svg.append("g")
128117
.attr("class", "y axis")
129118
.call(yAxis)
@@ -133,6 +122,8 @@
133122
.attr("dy", ".71em")
134123
.style("text-anchor", "end")
135124
.text("Downloads");
125+
126+
$("#statistics-graph-title-id").text("Downloads for 15 Latest Package Versions (Last 6 weeks)");
136127
}
137128

138129
var drawDownloadsByClientNameBarChart = function (rawData) {
@@ -222,20 +213,12 @@
222213
.attr("height", yScale.bandwidth())
223214
.append("title").text(function (d) { return d.downloads.toLocaleString() + " Downloads"; });
224215

225-
svg.append("foreignObject")
226-
.attr("x", 0)
227-
.attr("y", -10)
228-
.attr("width", width + "px")
229-
.attr("height", "2em")
230-
.attr("font-weight", "bold")
231-
.append("xhtml:body")
232-
.append("p")
233-
.attr("style", "text-align:center")
234-
.text("Downloads by Client (Last 6 weeks)");
235-
236216
svg.append("g")
237217
.attr("class", "y axis long")
238218
.call(yAxis);
219+
220+
221+
$("#statistics-graph-title-id").text("Downloads by Client (Last 6 weeks)");
239222
}
240223

241224
var GetChartData = function (rawData, filter) {

src/NuGetGallery/Views/Statistics/_PivotTable.cshtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
<div class="loader"></div>
4949
</div>
5050
<div class="col-sm-10" id="stats-data-display">
51-
<div class="stats-graph col-xs-12 hidden-tiny" id="statistics-graph-id"></div>
51+
<div class="stats-graph-title col-xs-12" id="statistics-graph-title-id"></div>
52+
<div class="stats-graph col-xs-12" id="statistics-graph-id"></div>
5253
<div class="stats-table-data">
5354
<table data-bind="if: Table" class="pivot-table table">
5455
<thead>

0 commit comments

Comments
 (0)