diff --git a/docs/SymptomsCausedByCOVIDLots/index.html b/docs/SymptomsCausedByCOVIDLots/index.html index d8ee236b925..1f48be1bb12 100644 --- a/docs/SymptomsCausedByCOVIDLots/index.html +++ b/docs/SymptomsCausedByCOVIDLots/index.html @@ -13870,6 +13870,7 @@ + diff --git a/docs/SymptomsCausedByCOVIDLots/js/SymptomVsSymptomChartDataProvider.js b/docs/SymptomsCausedByCOVIDLots/js/SymptomVsSymptomChartDataProvider.js index a59b72f1b6c..4168751077e 100644 --- a/docs/SymptomsCausedByCOVIDLots/js/SymptomVsSymptomChartDataProvider.js +++ b/docs/SymptomsCausedByCOVIDLots/js/SymptomVsSymptomChartDataProvider.js @@ -16,14 +16,16 @@ class SymptomVsSymptomChartDataProvider { dict1: prrByLotX, dict2: prrByLotY }); - return Object - .keys(prrByLotXCommon) - .map( - lot => - ({ - x: prrByLotXCommon[lot], - y: prrByLotYCommon[lot] - })); + const lots = Object.keys(prrByLotXCommon); + return { + labels: lots, + data: + lots.map( + lot => ({ + x: prrByLotXCommon[lot], + y: prrByLotYCommon[lot] + })) + }; } static #getCommonKeys(dict1, dict2) { diff --git a/docs/SymptomsCausedByCOVIDLots/js/SymptomVsSymptomChartView.js b/docs/SymptomsCausedByCOVIDLots/js/SymptomVsSymptomChartView.js index b3db01ea086..493548e77a9 100644 --- a/docs/SymptomsCausedByCOVIDLots/js/SymptomVsSymptomChartView.js +++ b/docs/SymptomsCausedByCOVIDLots/js/SymptomVsSymptomChartView.js @@ -7,6 +7,7 @@ class SymptomVsSymptomChartView { this.#canvas = canvas; } + // FK-TODO: refactor displayChart(symptomX, symptomY) { if (this.#chart != null) { this.#chart.destroy(); @@ -21,8 +22,8 @@ class SymptomVsSymptomChartView { const chartData = SymptomVsSymptomChartDataProvider.getChartData({ prrByLotX, prrByLotY }); const data = { datasets: [{ - label: 'Scatter Dataset', - data: chartData, + labels: chartData.labels, + data: chartData.data, backgroundColor: 'rgb(0, 0, 255)' }], }; @@ -35,6 +36,18 @@ class SymptomVsSymptomChartView { type: 'linear', position: 'bottom' } + }, + plugins: { + legend: { + display: false + }, + tooltip: { + callbacks: { + label: function (context) { + return 'Batch: ' + context.dataset.labels[context.dataIndex]; + } + } + } } } }; diff --git a/docs/SymptomsCausedByCOVIDLots/test/SymptomVsSymptomChartDataProviderTest.js b/docs/SymptomsCausedByCOVIDLots/test/SymptomVsSymptomChartDataProviderTest.js index 66fa15d6cf8..bada17d4c58 100644 --- a/docs/SymptomsCausedByCOVIDLots/test/SymptomVsSymptomChartDataProviderTest.js +++ b/docs/SymptomsCausedByCOVIDLots/test/SymptomVsSymptomChartDataProviderTest.js @@ -67,11 +67,14 @@ QUnit.module('SymptomVsSymptomChartDataProviderTest', function () { // Then assert.deepEqual( chartData, - [ - { - x: 2.0, - y: 3.0 - } - ]); + { + labels: ["lotCommon"], + data: [ + { + x: 2.0, + y: 3.0 + } + ] + }); }); }); \ No newline at end of file