File tree Expand file tree Collapse file tree 4 files changed +5
-8
lines changed
Expand file tree Collapse file tree 4 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,7 @@ const props = defineProps<{
3131
3232const { locale } = useI18n ()
3333const colorMode = useColorMode ()
34- const numberFormatter = useNumberFormatter ({
35- maximumFractionDigits: 0 ,
36- })
34+ const numberFormatter = useNumberFormatter ()
3735const resolvedMode = shallowRef <' light' | ' dark' >(' light' )
3836const rootEl = shallowRef <HTMLElement | null >(null )
3937const palette = getPalette (' ' )
Original file line number Diff line number Diff line change @@ -1540,7 +1540,7 @@ const chartConfig = computed<VueUiXyConfig>(() => {
15401540 const rows = items
15411541 .map ((d : Record <string , any >) => {
15421542 const label = String (d ?.name ?? ' ' ).trim ()
1543- const raw = Math . round ( Number (d ?.value ?? 0 ) )
1543+ const raw = Number (d ?.value ?? 0 )
15441544 const v = compactNumberFormatter .value .format (Number .isFinite (raw ) ? raw : 0 )
15451545
15461546 if (! hasMultipleItems ) {
Original file line number Diff line number Diff line change @@ -60,9 +60,7 @@ function handleModalTransitioned() {
6060}
6161
6262const { fetchPackageDownloadEvolution } = useCharts ()
63- const numberFormatter = useNumberFormatter ({
64- maximumFractionDigits: 0 ,
65- })
63+ const numberFormatter = useNumberFormatter ()
6664
6765const { accentColors, selectedAccentColor } = useAccentColor ()
6866
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export interface ChartFilterSettings {
8383}
8484
8585/**
86- * Applies moving average then smoothing in sequence.
86+ * Applies moving average, smoothing and then rounding up in sequence.
8787 */
8888export function applyDataCorrection < T extends { value : number } > (
8989 data : T [ ] ,
@@ -92,5 +92,6 @@ export function applyDataCorrection<T extends { value: number }>(
9292 let result = data
9393 result = movingAverage ( result , settings . averageWindow )
9494 result = smoothing ( result , settings . smoothingTau )
95+ result = result . map ( d => ( { ...d , value : Math . ceil ( d . value ) } ) )
9596 return result
9697}
You can’t perform that action at this time.
0 commit comments