Theme/Font

I am trying to copy the stacked bar chart example from https://blazor.syncfusion.com/demos/chart/stacked-bar?theme=bootstrap5

It works but the font is drawn as Times Roman style, not like the rest of the page

I had to omit the 

Theme="@Theme" code as when I add 

@using ThemeHelper

It has red underline and Image_2039_1716233829081

Is this the cause of the font? How do I get ThemeHelper to work?

Image_4043_1716233654825


1 Reply

IG Ilamathi Govindaraj Syncfusion Team May 22, 2024 09:41 AM UTC

Hi Richard,


We have analyzed your query regarding the font rendering issue in the stacked bar chart. We utilized ThemeHelper in the stacked bar demo sample to obtain the selected theme. Instead of using ThemeHelper, you can directly utilize the Theme property in the SfChart to set themes for the stacked bar chart. We have modified the sample with the Bootstrap5 theme so that the default font family, Helvetica, for this theme is applied. If a theme is not set, the default material theme will apply and the chart will render with the Roboto font family. You can further adjust the font based on your requirements using its properties. 

Code Snippet:

    <SfChart Title="Sales Comparison" Width="@Width" Theme="Theme.Bootstrap5">


Sample : https://blazorplayground.syncfusion.com/LNBftohrVplTYfDA


For more information about customizing the font of the chart, please refer to the documentation links below.


Axis labels - https://blazor.syncfusion.com/documentation/chart/axis-labels#labels-customization

Data labels -https://blazor.syncfusion.com/documentation/chart/data-labels#customization

Tooltip - https://blazor.syncfusion.com/documentation/chart/tool-tip#tooltip-customization

Chart title - https://blazor.syncfusion.com/documentation/chart/chart-appearance#chart-title

Subtitle - https://blazor.syncfusion.com/documentation/chart/chart-appearance#chart-subtitle


Kindly revert us if you have any concerns.

Regards,

Ilamathi Govindaraj.


Loader.
Up arrow icon