Skip to content

Commit

Permalink
feat(components): show tooltip count and total count on bubble plot t…
Browse files Browse the repository at this point in the history
…o first digit

resolves #25
  • Loading branch information
JonasKellerer committed Apr 4, 2024
1 parent 74cfdac commit 57aafc3
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ const PrevalenceOverTimeBubbleChart = ({ data, yAxisScaleType }: PrevalenceOverT
label: (context) => {
const dataset = data[context.datasetIndex!];
const dataPoint = dataset.content[context.dataIndex!];
return `${dataset.displayName}: ${(dataPoint.prevalence * 100).toFixed(2)}%, ${dataPoint.count}/${
dataPoint.total
} samples`;

const percentage = (dataPoint.prevalence * 100).toFixed(2);
const count = dataPoint.count.toFixed(0);
const total = dataPoint.total.toFixed(0);

return `${dataset.displayName}: ${percentage}%, ${count}/${total} samples`;
},
},
},
Expand Down

0 comments on commit 57aafc3

Please sign in to comment.