Can I use web fonts with ZingChart?

Yes, you can definitely use web fonts in ZingChart. The first step is to include the font into your html page.

<head>

<link href='http://fonts.googleapis.com/css?family=Josefin+Sans' rel='stylesheet' type='text/css'>

</head>

 Next, You will want to specify the font family in each object you have text in: For example, title, subtitle, etc. You could also set it for everything in the chart in the "globals" object. 

 type:'bar',
 globals:{
  fontFamily:'Josefin Sans',
}...

You can also add the font defined for your chart in the render method and it will give you the same results! Whatever looks aesthetically better to you, choose that method for rendering your font.

zingchart.render({
  ...
  defaults:{
    fontFamily:'Josefin Sans'
  }
});

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.