Skip to content

Commit

Permalink
Flip scatter plot
Browse files Browse the repository at this point in the history
  • Loading branch information
haneslinger committed May 22, 2024
1 parent 805e3b8 commit 219dc81
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions seed/static/seed/js/controllers/inventory_reports_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@ angular.module('BE.seed.controller.inventory_reports', []).controller('inventory
const label = [];
const labeltmp = $scope.chartData.chartData.filter((entry) => entry.id === ctx.raw.id);
if (labeltmp.length > 0) {
label.push(`${$scope.yAxisSelectedItem.label}: ${ctx.formattedValue}`);
label.push(`${$scope.yAxisSelectedItem.label}: ${type=="bar"? ctx.label: ctx.parsed.x}`);

Check failure on line 269 in seed/static/seed/js/controllers/inventory_reports_controller.js

View workflow job for this annotation

GitHub Actions / formatting (lint)

Operator '==' must be spaced

Check failure on line 269 in seed/static/seed/js/controllers/inventory_reports_controller.js

View workflow job for this annotation

GitHub Actions / formatting (lint)

Expected '===' and instead saw '=='

Check failure on line 269 in seed/static/seed/js/controllers/inventory_reports_controller.js

View workflow job for this annotation

GitHub Actions / formatting (lint)

Strings must use singlequote

Check failure on line 269 in seed/static/seed/js/controllers/inventory_reports_controller.js

View workflow job for this annotation

GitHub Actions / formatting (lint)

Operator '?' must be spaced

Check failure on line 269 in seed/static/seed/js/controllers/inventory_reports_controller.js

View workflow job for this annotation

GitHub Actions / formatting (lint)

Operator ':' must be spaced
// The x axis data is generated more programmatically than the y, so only
// grab the `label` since the `axisLabel` has redundant unit information.
label.push(`${$scope.xAxisSelectedItem.label}: ${ctx.parsed.x}`);
label.push(`${$scope.xAxisSelectedItem.label}: ${type=="bar"? ctx.parsed.y: ctx.formattedValue}`);

Check failure on line 272 in seed/static/seed/js/controllers/inventory_reports_controller.js

View workflow job for this annotation

GitHub Actions / formatting (lint)

Operator '==' must be spaced

Check failure on line 272 in seed/static/seed/js/controllers/inventory_reports_controller.js

View workflow job for this annotation

GitHub Actions / formatting (lint)

Expected '===' and instead saw '=='

Check failure on line 272 in seed/static/seed/js/controllers/inventory_reports_controller.js

View workflow job for this annotation

GitHub Actions / formatting (lint)

Strings must use singlequote

Check failure on line 272 in seed/static/seed/js/controllers/inventory_reports_controller.js

View workflow job for this annotation

GitHub Actions / formatting (lint)

Operator '?' must be spaced

Check failure on line 272 in seed/static/seed/js/controllers/inventory_reports_controller.js

View workflow job for this annotation

GitHub Actions / formatting (lint)

Operator ':' must be spaced
}
return label;
}
Expand Down Expand Up @@ -395,8 +395,8 @@ angular.module('BE.seed.controller.inventory_reports', []).controller('inventory
$scope.chart1Title = $translate.instant('X_VERSUS_Y', interpolationParams);
$scope.chart2Title = $translate.instant('X_VERSUS_Y_AGGREGATED', interpolationParams);

$scope.scatterChart.options.scales.x.title.text = $scope.xAxisSelectedItem.label;
$scope.scatterChart.options.scales.y.title.text = $scope.yAxisSelectedItem.label;
$scope.scatterChart.options.scales.y.title.text = $scope.xAxisSelectedItem.label;
$scope.scatterChart.options.scales.x.title.text = $scope.yAxisSelectedItem.label;

$scope.barChart.options.scales.y.title.text = $scope.xAxisSelectedItem.label;
$scope.barChart.options.scales.x.title.text = $scope.yAxisSelectedItem.label;
Expand Down Expand Up @@ -432,8 +432,8 @@ angular.module('BE.seed.controller.inventory_reports', []).controller('inventory
The chart will update automatically as it's watching the chartData property on the scope.
*/
function getChartData() {
const xVar = $scope.xAxisSelectedItem.varName;
const yVar = $scope.yAxisSelectedItem.varName;
const yVar = $scope.xAxisSelectedItem.varName;
const xVar = $scope.yAxisSelectedItem.varName;
$scope.chartIsLoading = true;

inventory_reports_service
Expand Down

0 comments on commit 219dc81

Please sign in to comment.