Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Move legend below plot and allow plot resize.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpatrick committed Jan 14, 2016
1 parent 512b8da commit 7eae9a9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/tracker/public/css/trend/trend.view.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 19 additions & 2 deletions modules/tracker/public/js/trend/trend.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ midas.tracker.renderChartArea = function (curveData, first) {
opts.legend = {
show: true,
labels: [json.tracker.trends[0].display_name, json.tracker.rightTrend.display_name],
location: 'se'
location: 's',
placement: 'outsideGrid'
};
opts.axes.y2axis = {
show: true,
Expand Down Expand Up @@ -234,7 +235,8 @@ midas.tracker.renderChartArea = function (curveData, first) {
});
opts.legend = {
show: true,
location: 'se',
location: 's' ,
placement : 'outsideGrid',
labels: labels
};
}
Expand Down Expand Up @@ -263,13 +265,25 @@ midas.tracker.renderChartArea = function (curveData, first) {
midas.tracker.populateInfo(curveData);
};

midas.tracker.resizePlotContainer = function () {
var filterHeight = $('.branchFilterContainer').height();
$('.SubMainContent').css('height', $(window).height()-150 + 'px');
$('.viewMain').css('height', $(window).height()-(filterHeight+300) + 'px');
};

$(window).load(function () {
'use strict';

var inputCurves = json.tracker.scalars;
if (json.tracker.rightTrend) {
inputCurves.push(json.tracker.rightScalars);
}
var curveData = midas.tracker.extractCurveData(inputCurves);
midas.tracker.resizePlotContainer();
$(window).resize(function () {
midas.tracker.resizePlotContainer();
midas.tracker.updateBranchFilters();
});

if (json.tracker.trends.length == 1) {
midas.tracker.yaxisLabel = json.tracker.trends[0].display_name;
Expand Down Expand Up @@ -342,6 +356,8 @@ $(window).load(function () {
div.append($($('.branchfilter')[0]).clone()).append(removeLink);

$('.branchFilterContainer').append(div);
midas.tracker.resizePlotContainer();
midas.tracker.renderChartArea(curveData, false);
});

midas.tracker.renderChartArea(curveData, true);
Expand Down Expand Up @@ -407,6 +423,7 @@ $(window).load(function () {
var curveData = midas.tracker.extractCurveData(inputCurves);
midas.tracker.renderChartArea(curveData, false);
});

});

midas.tracker.trendDeleted = function (resp) {
Expand Down
2 changes: 1 addition & 1 deletion modules/tracker/public/scss/trend/trend.view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ input.dateSelect {
}

div.chartContainer {
height: 360px;
height: 100%;
width: 100%;
}

Expand Down

0 comments on commit 7eae9a9

Please sign in to comment.