indexLabelLineColor: String

Sets the color of line connecting index labels with their dataPoint. It is only applicable for pie and doughnut chart when indexLabelPlacement is outside. For other chart-types, indexLabelLineThickness should be set greater than zero. The value of indexLineColor can be a “HTML Color Name” or “hex code” or “rgba values” .


Default: “lightgrey”
Example: “red”, “#FAC003”..

Notes
  • Works only in case of pie and doughnut charts.


var  chart =  new  CanvasJS.Chart("container",
{
 .
 .
 data: [{
  dataPoints: [
   { y: 10, indexLabel:"apple", indexLabelLineColor: "green" },

   ],
  },

 ]
 .
 .
});
chart.render();


Try it Yourself by Editing the Code below.



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

Comments 2

  1. Is it possible to remove labels and their lines in the graph, but still keep it in the tooltip?

    • Yes, you can hide labels by setting valueFormatString of axis to a space character and hide ticks by setting tickLength to 0. Please refer to this example.

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