summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js b/app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js
index a99ce0f1c36..d7f4cae971b 100644
--- a/app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js
+++ b/app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js
@@ -109,7 +109,7 @@ export const ContributorsMasterGraph = (function(superClass) {
this.data = data1;
this.update_content = this.update_content.bind(this);
- this.width = $('.content').width() - parentPadding - (this.MARGIN.left + this.MARGIN.right);
+ this.width = $('.stat-graph').width() - parentPadding - (this.MARGIN.left + this.MARGIN.right);
this.height = 200;
this.x = null;
this.y = null;
@@ -218,12 +218,15 @@ export const ContributorsAuthorGraph = (function(superClass) {
extend(ContributorsAuthorGraph, superClass);
function ContributorsAuthorGraph(data1) {
+ const $parentElements = $('.person');
+ const parentPadding = parseFloat($parentElements.css('padding-left')) + parseFloat($parentElements.css('padding-right'));
+
this.data = data1;
// Don't split graph size in half for mobile devices.
if ($(window).width() < 768) {
- this.width = $('.content').width() - 80;
+ this.width = $('.stat-graph').width() - parentPadding - (this.MARGIN.left + this.MARGIN.right);
} else {
- this.width = ($('.content').width() / 2) - 100;
+ this.width = ($('.stat-graph').width() / 2) - parentPadding - (this.MARGIN.left + this.MARGIN.right);
}
this.height = 200;
this.x = null;