indexLabelWrap: Boolean

indexLabelWrap specifies whether to wrap or clip indexLabel once its width crosses indexLabelMaxWidth.

Default: true
Options: true, false

Notes
  • Supported in all Chart Types.


var  chart =  new  CanvasJS.Chart("container",
{
 .
 .
 data:[{
    type : "pie",
    indexLabelMaxWidth: 20,
    indexLabelWrap: true // change to false 
  },
 ]
 .
 . 
});
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

Comments 2

  1. can i show label under y value ? Here 34kg under mango is right.. But the ‘mango’ will be change ‘pineapple’ means it is displaying wrong.

    • amutha,

      Purpose of indexLabelMaxWidth is to limit the maximum width of a label and not to insert a line break. In order to get the requested behaviour you’ll need line break characters which are not supported yet.

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