As answered here I'm using nested arrays to line break my labels on ChartsJS and it works fine but if I try to use nested arrays on my label (the object inside dataset) they won't line break.
For example in this graph:
I have 2 labels with new lines but if I try the same technique with my label (the legend above the graph) it won't line break.
Here is the code for this graph:
data: { labels: [ 'Utensilios para escrita e artes','Faz de conta','Jogos',['Materiais não estruturado','/de largo alcançe/recicláveis'],['Repertório artístico-cultural e','científico de diferentes','origens étnico-raciais'],'Livros de história','Materiais para pesquisa',],
datasets: [
{ maxBarThickness: 70,label: 'Não há material presente',
backgroundColor: '#eb7071',
borderWidth: 1,
data: [ 2,41,24,51,78,33,62,]
},
{ maxBarThickness: 70,label: ['Material presente,',' mas crianças não usaram'],
backgroundColor: '#f9ae60',
borderWidth: 1,
data: [ 24,38,48,39,15,48,30,]
},
{ maxBarThickness: 70,label: 'Crianças usaram os materiais',
backgroundColor: '#73e599',
borderWidth: 1,
data: [ 73,21,28,10,7,20,7,]
},
]
},
I assumed the legend would not line break because in the code it was not a nested array so I changed my label to this:
label: [['Material presente,',' mas crianças não usaram']]
But it still did not work.
Is there any way to line break these legends without having to generate them as a HTML script to manipulate them?