theme: String

Sets the theme of the StockChart. Library comes with various predefined themes. You can easily switch between predefined themes by changing theme property.

Default: “light1”
Options: “light1”, “light2”, “dark1”, “dark2”

  • Theme set in individual charts and navigator overrides the theme set in StockChart.

var stockChart = new CanvasJS.StockChart("container",
 theme: "dark1", // "light1", "light2", "dark2"

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