text: String

Sets the Title’s text.


Default: null
Example: “Chart title”

Notes
  • If the text is very long, it automatically gets wrapped.


var  chart =  new  CanvasJS.Chart("container",
{
 .
 .
 title:{
   text: "This is Title Text",
 },
 .
 .
});
chart.render();


Try it Yourself by Editing the Code below.

  Also See:    



In order to provide better support,we have closed the comments and switched completely to our Forums.
If you have any questions, please feel free to ask in our forums.

Comments 4

  1. Hi Sunil,

    I may not know the title for the chart ahead of time. So for example I was trying to do this;

    chart.title.text = ” a dynamic title gathered from a json file or json response”;

    Then of course

    chart.render;

    Is this possible?

    Thanks,
    Jim

  2. I answered my own question it is:
    chart.options.title.text = “some new thing you want here”;
    chart.render();

    Assuming the chart is named chart via:

  3. James,

    I can confirm that “chart.options.title.text” is the right way to go.

    We haven’t added this in documentation because it is fully not supported yet – around 95% of parameters are supported as of now. So we just need to support few more parameters before making it public.

In order to provide better support,we have closed the comments and switched completely to our Forums.
If you have any questions, please feel free to ask in our forums.