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 Editing The Code

  Also See:    


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

4 Comments

  1. jamesf says:

    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. jamesf says:

    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. Sunil Urs says:

    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.

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