Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Fix cosmetic issues with cut off chart overflows. #19794

Merged
merged 2 commits into from Jun 11, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+9 −3
Diff settings

Always

Just for now

@@ -29,7 +29,7 @@ module.directive('mlEventRateChart', function () {

let svgWidth = 0;
const barChartHeight = scope.eventRateChartHeight;
const margin = { top: 0, right: 0, bottom: 20, left: scope.chartTicksMargin.width };
const margin = { top: 5, right: 1, bottom: 20, left: scope.chartTicksMargin.width };
const svgHeight = barChartHeight + margin.top + margin.bottom;
let vizWidth = svgWidth - margin.left - margin.right;
const chartLimits = { max: 0, min: 0 };
@@ -120,9 +120,15 @@ module.directive('mlEventRateChart', function () {
}
swimlaneXScale.domain(d3.extent(finerData, d => d.date));


// Extent the time range/domain at the end by 1 barsInterval,

This comment has been minimized.

Copy link
@peteharverson

peteharverson Jun 11, 2018

Contributor

Should be 'Extend' rather than 'Extent' !

// otherwise the last bar will start at the end of vizWidth
// and overflow the chart.
const timeExtent = d3.extent(data, d => d.date);
timeExtent[1] = new Date(timeExtent[1].getTime() + scope.chartData.barsInterval);
barChartXScale = d3.time.scale()
.range([0, vizWidth])
.domain(d3.extent(data, d => d.date));
.domain(timeExtent);

chartLimits.max = d3.max(data, (d) => d.value);
chartLimits.min = 0;
@@ -27,7 +27,7 @@ module.directive('mlMultiMetricJobChart', function () {

let svgWidth = 0;
const lineChartHeight = scope.chartHeight;
const margin = { top: 0, right: 0, bottom: 20, left: scope.chartTicksMargin.width };
const margin = { top: 5, right: 1, bottom: 20, left: scope.chartTicksMargin.width };
const svgHeight = lineChartHeight + margin.top + margin.bottom;
let vizWidth = svgWidth - margin.left - margin.right;
const chartLimits = { max: 0, min: 0 };
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.