How to format legend labels within a Calendar?
See original GitHub issueHi! I’ve searched the docs, storybook and this repo to find a way to do it but I was not successful.
I need to format legend labels within a Calendar. Currently, my raw values range from 0 to ~70,000.
I’d like to format these values as follows:
Is there anyway to do it?
I’ve tried to pass a function inside the legend object, but it didn’t work:
// ...
legends: [
{
// ...
legendFormat: ({ value }) => myFormatter(value),
// ...
},
],
Thanks! 😃
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:5
Top Results From Across the Web
Add and format a chart legend - Microsoft Support
Right-click the legend, and then click Format Legend. · In the Format Legend task pane, pick the options that you want. Format Legend...
Read more >What's a Calendar Legend? | Keep&Share Support
To set up a Calendar Legend label for your Calendar, first, click on the “Customize” button in the blue bar above your Calendar....
Read more >How to Label a Legend in Google Sheets - YouTube
In this video, I show how to label a legend in Google Sheets. I cover how to add labels to legends and how...
Read more >Use color labels to track calendar entries - Google Support
From the Time Insights panel: · Create a new color label: At the bottom left, click Add a new color label . ·...
Read more >How to edit legend labels in google spreadsheet plots?
I had the same question this year (2021), and it looks like there's support for it now. In ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also needed this feature, but the library does not support it yet. However, this feature can be used with a little workaround, but we should do a PR if we want to use it the proper way.
Workaround
@nivo/calendar uses colorScale function when it does create legends.
We can pass new colorScale function on @nivo/calendar props
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!