Skip to content
Snippets Groups Projects
Commit 0c6e98f9 authored by MahiFaiyaz's avatar MahiFaiyaz
Browse files

Dynamically get tooltip labels

parent 3cd9a99b
No related branches found
No related tags found
1 merge request!4Subreddit feature
......@@ -18,13 +18,14 @@ const formatData = (data, dataKey, dataValue) => {
if (dataKey === "author") {
obj['label'] = key
if (key.length > 8) {
console.log(key.length)
obj['label'] = key.slice(0,6) + ".."
}
}
result.push(obj)
}
result.sort((a,b) => b.comments - a.comments)
result.sort((a,b) => {
return b[dataValue] - a[dataValue]})
console.log(result)
return result
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment