Changing typography inside a chart widget

Hi,

We use early style sheets to import the Inter variable font from our uploaded assets. Our late style sheet, which is externally stored and then imported via the theme pack, sets font styling across all our elements, as well as enabling stylistic set ss02 for the Inter font family.

This works for practically every widget and element we use in our Host applications, besides charts. Charts are stored within a canvas HTML element and as a result there isn’t an obvious way as to how we can control the typography used inside chart to a similar level of customisation that Sass allows us to. Internally, one of our team members reported that the chart font has now changed to something vastly different:

We’ve confirmed that this font isn’t being set in their browser settings either.

Is there any way we can control the typography used in charts, whether that’s through Sass styling or within Build Studio?

Happy to share any additional details if necessary.

Thanks,

Wai

Hello There,

I see nobody has been able to advise you on this. I am reaching out to the business to see if anyone can help.

Best Regards - MP

After discussions within the business I have the following reply for you!

Sadly as the system is placing the charts using canvas there are no CSS based controls that can modify the typography as the element is already pixels by the time it is rendered on screen. In the meantime, I have raised a ticket to see if the options for editing the settings can be exposed in the ‘Cosmetics’ panel of the chart editor.

Regards - MP

Hi Mark,

Thanks for responding and going out of your way to get this added in the chart editor, it’ll be a great addition.

In the meantime, I figured out this was happening because the canvas was using the default browser sans serif font, as it would be created before our actual font was loaded in the early style sheet.

Because I had defined font-feature-settings as always being set to ss02 in the late style sheet, and suffixing it with !important as that seems to be the only way to outright overwrite Liberty Create styling, my guess is that the canvas element also forced the canvas font to also use ss02 on Arial.

I fixed it by defining the imported font to use ss02 only inside the early style sheet, and removing the definition from the late style sheet. The canvas element still uses Arial so it would be great if we could replace it with our own imported fonts we upload in assets, but I know this is fundamentally a limitation with canvas elements so it’s easier said than done.

As to why we were even using ss02 stylistic set, we use Inter Variable across our design system, and ss02 has some great accessibility features such as distinct zeroes, tailed eyes and tees, etc.

Many thanks again for your attention

Hello Again, my pleasure. I will obviously keep you updated here if there are any further developments!

Thank you for engaging with the Netcall Community. We’re here to help!

Regards - MP