Unverified Commit f490f445 authored by Wesley Liddick's avatar Wesley Liddick Committed by GitHub
Browse files

Merge pull request #699 from geminiwen/fix/dashboard-tooltip-token-sort

fix(dashboard): sort recent usage tooltip labels by token consumption
parents 3613695f 5c856460
......@@ -366,6 +366,11 @@ const lineOptions = computed(() => ({
}
},
tooltip: {
itemSort: (a: any, b: any) => {
const aValue = typeof a?.raw === 'number' ? a.raw : Number(a?.parsed?.y ?? 0)
const bValue = typeof b?.raw === 'number' ? b.raw : Number(b?.parsed?.y ?? 0)
return bValue - aValue
},
callbacks: {
label: (context: any) => {
return `${context.dataset.label}: ${formatTokens(context.raw)}`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment