padding: Number or Object

This property allows you to set the padding for Chart Title.


Default: 0
Example: 5, 8 ..

Notes
  • It is recommended to apply padding when enclosing the title with border.
  • Padding is applied in all directions.

var  chart =  new  CanvasJS.Chart("container",
{
 .
 .
 title: {
   padding: 2
 },
 .
 .
});
chart.render();

Padding can also be an object containing top, right, bottom and left properties for different padding along top, right, bottom and left sides respectively.

var  chart =  new  CanvasJS.Chart("container",
{
 .
 .
 title:{
   padding: {
     top: 1,
     right: 1,
     bottom: 2,
     left: 2
   },
 },
 .
 .
});
chart.render();



Try it Yourself by Editing the Code below.

  Also See:    



If you have any questions, please feel free to ask in our forums.Ask Question