chartist-js / chartist

Simple responsive charts
https://chartist.dev
MIT License
13.34k stars 2.53k forks source link

Donut chart long labels overlapping slice #1107

Open vincentchin opened 6 years ago

vincentchin commented 6 years ago

For a donut chart like this,

new Chartist.Pie('.ct-chart', {
  labels: ['Really Long Label 1', 'Really Long Label 2', 'Really Long Label 3', 'Really Long Label 4'],
  series: [20, 10, 30, 40]
}, {
  donut: true,
  donutWidth: 115,
  donutSolid: true,
  startAngle: 0,
});

is there a way to have control on how labels fit into a slice like forcing a line-break?

Arantiryo commented 1 year ago

Hi @vincentchin 👋

In case it's still relevant, it should be possible by listening for draw events (an example can be found here) and modifying the text element in a way described in this article.