question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Font Awesome icons not rendering

See original GitHub issue

I’m trying to show font awesome (4.7) icons as data labels, which seems like it should work because other unicode characters in other font families seem to work ok. Is there something else I should be doing besides the following?

this.options = {
    plugins: {
        datalabels: {
            color: 'white',
            display: context => {
                return context.dataset.data[context.dataIndex] > 15;
            },
            font: {
                weight: 'bold',
                family: 'FontAwesome',
                style: 'normal'
            },
            formatter: (value, context) => {
                return `\\u${context.dataset.icon_code}`;
            }
        }
    },
    ...
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
simonbrunelcommented, Mar 21, 2018

font should be under datalabels, in your file it’s under plugins and font.size should be a number, not a string (same for lineHeight).

1reaction
ericsvendsencommented, Jan 16, 2018

Yes, however for this app the datasets are being dynamically generated, and for various reasons the associated icon codes are only stored in the db as f0c3 (for example). As a result I need to build the unicode values at runtime.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Font Awesome Docs
Are you using Font Awesome Free or Pro? - Some icons are only available in Font Awesome Pro. Double-check that the icon you...
Read more >
html - Font Awesome icons are not working, I have included all ...
I am trying to use Font Awesome icons of version 4.1.0 on my website but they are not working, I have referenced them...
Read more >
[Solved]: Font Awesome icons not showing on my website
How to fix Font Awesome version related issues. Check and confirm the Font Awesome version used on your website. To do so, open...
Read more >
Why are my Font Awesome icons failing to show? - SiteFarm
First, determine which version of the Font Awesome library is currently being used on your SiteFarm site by right-clicking anywhere on the ...
Read more >
Font Awesome Icons Not Showing: Ultimate Reference Guide
Check your Adblockers. An ad blocker can potentially stop icons from loading. Alternatively, you can long click the refresh icon, or use keyboard...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found