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


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

2 Comments

  1. sem van meurs says:

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

    • Sunil Urs says:

      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