diff --git a/src/lib/components/ClinicalTrial.svelte b/src/lib/components/ClinicalTrial.svelte index 2f79abba..7f822492 100644 --- a/src/lib/components/ClinicalTrial.svelte +++ b/src/lib/components/ClinicalTrial.svelte @@ -60,22 +60,6 @@ function handleViewData(trialData) { openPopup?.dispatchEvent(new MouseEvent('click')) } -function normalizer(value) { - if (Math?.abs(value) >= 1e18) { - return { unit: 'Q', denominator: 1e18 }; - } else if (Math?.abs(value) >= 1e12) { - return { unit: 'T', denominator: 1e12 }; - } else if (Math?.abs(value) >= 1e9) { - return { unit: 'B', denominator: 1e9 }; - } else if (Math?.abs(value) >= 1e6) { - return { unit: 'M', denominator: 1e6 }; - } else if (Math?.abs(value) >= 1e5) { - return { unit: 'K', denominator: 1e5 }; - } else { - return { unit: '', denominator: 1 }; - } -} - function getPlotOptions() { let dates = []; @@ -109,11 +93,9 @@ function getPlotOptions() { // Update valueList with the count of each fiscal year valueList = dates?.map(fiscalYear => fiscalYearCount[fiscalYear]); - - const {unit, denominator } = normalizer(Math.max(...valueList) ?? 0) - const option = { silent: true, + animation: false, tooltip: { trigger: 'axis', hideDelay: 100, // Set the delay in milliseconds @@ -131,20 +113,17 @@ function getPlotOptions() { color: '#fff', } }, - yAxis: [ - { - type: 'value', - splitLine: { + yAxis: [ + { + type: 'value', + splitLine: { show: false, // Disable x-axis grid lines - }, - axisLabel: { - color: '#fff', // Change label color to white - formatter: function (value) { - return '#'+(value / denominator)?.toFixed(0) + unit; // Format value in millions - }, - }, - }, - ], + }, + axisLabel: { + show: false // Hide y-axis labels + } + } + ], series: [ { name: '# of Trials', @@ -264,13 +243,11 @@ let charNumber = 20; - + {formatString(item['Study Status'])} @@ -312,10 +287,9 @@ let charNumber = 20; {/each} - - + --> {/if}