diff options
author | Christian Hogan <github@infliction.org> | 2014-03-25 14:43:36 -0400 |
---|---|---|
committer | suelockwood <deathbear@apache.org> | 2014-03-25 15:19:18 -0400 |
commit | 7296e53c8dcd5d69d83bd04a4421887390c06816 (patch) | |
tree | 3c16e305f8626724201a53d5b5213fc4f3ba8d59 | |
parent | b1255309eca961d188d40ef509e7541a3d4ad14e (diff) | |
download | couchdb-7296e53c8dcd5d69d83bd04a4421887390c06816.tar.gz |
Updating pie chart to reflect nvd3's removal of pie.values(), tweaking CSS to make pie chart fit all nice like.
-rw-r--r-- | src/fauxton/app/addons/stats/assets/less/stats.less | 5 | ||||
-rw-r--r-- | src/fauxton/app/addons/stats/templates/pie_table.html | 6 | ||||
-rw-r--r-- | src/fauxton/app/addons/stats/views.js | 7 |
3 files changed, 13 insertions, 5 deletions
diff --git a/src/fauxton/app/addons/stats/assets/less/stats.less b/src/fauxton/app/addons/stats/assets/less/stats.less index 7ec88b95b..43ddb3b69 100644 --- a/src/fauxton/app/addons/stats/assets/less/stats.less +++ b/src/fauxton/app/addons/stats/assets/less/stats.less @@ -13,3 +13,8 @@ .datatypes { padding: 0 15px; } + +.span5 { + height:450px; + min-width: 450px; +}
\ No newline at end of file diff --git a/src/fauxton/app/addons/stats/templates/pie_table.html b/src/fauxton/app/addons/stats/templates/pie_table.html index 1fa781a40..8c4682ce3 100644 --- a/src/fauxton/app/addons/stats/templates/pie_table.html +++ b/src/fauxton/app/addons/stats/templates/pie_table.html @@ -46,5 +46,9 @@ the License. </table> </div> - <svg id="<%= datatype %>_graph"></svg> + <div class="span5"> + <center> + <svg id="<%= datatype %>_graph"></svg> + </center> + </div> </div> diff --git a/src/fauxton/app/addons/stats/views.js b/src/fauxton/app/addons/stats/views.js index 9dd9cbcde..c8374adb3 100644 --- a/src/fauxton/app/addons/stats/views.js +++ b/src/fauxton/app/addons/stats/views.js @@ -70,21 +70,20 @@ function(app, FauxtonAPI,Stats) { series = _.sortBy(series, function(d){return -d.y;}); nv.addGraph(function() { - var width = 550, - height = 400; + var width = 440, + height = 440; var chart = nv.models.pieChart() .x(function(d) { return d.key; }) .y(function(d) { return d.y; }) .showLabels(true) .showLegend(false) - .values(function(d) { return d; }) .color(d3.scale.category10().range()) .width(width) .height(height); d3.select(chartelem) - .datum([series]) + .datum(series) .transition().duration(300) .attr('width', width) .attr('height', height) |