itemTextAlign: String

Sets the text alignment of the legend. This feature is useful when itemWrap is set to true, and the legend text length exceeds itemMaxWidth, making it wrap onto multiple lines.

Default: “left”
Options: “left”, “center”, “right”
var  chart =  new  CanvasJS.Chart("container", {
 .
 .
 legend: {
	itemTextAlign: "center" // change to "left" / "right"
   },
 .
 . 
});
chart.render();

Try Editing The Code

  Also See:    


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