TypeScript, Chart.js, Tailwindss && first mobile 👌
Design comparison
Solution retrospective
Any suggestions is always welcome 🖐
Community feedback
- @festsnusaPosted almost 2 years ago
Great job!
I'm not familiar with Typescript & TailwindCSS, but for this challenge I used Chart.js just like you did. I didn't find any information of how to round the bottom corners of columns. I don''t know how to display $ sign while hovering a column and I didn't remove separators between columns.
Can you please tell me how to display $ & how to remove separators?
Thanks in advance.
0@gamcode98Posted almost 2 years ago@festsnusa Hi, of course I can tell you. Inside the tooltip object you can use callbacks like:
callbacks: { label: function (context) { let label = context.dataset.label || '' if (label) { label += ': ' } if (context.parsed.y !== null) { label += new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(context.parsed.y) } return label }, }
You can see more examples in here
About separators inside scales object:
y: { display: false, }
Just need to declare display in false
I hope I have helped you in some way at least. Anyway, feel free to see my repo . I've just write a little of TypeScript.
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord