Wie kann ich die Etikettenumbruchfunktion von Mike Bostock (https://bl.ocks.org/mbostock/7555321) in mein nvd3-Diagramm einfügen?Wie fügt man dem NVD3-Graphen eine Umbruchfunktion hinzu?
createChart(graph_data, tickValue){
if (graph_data) {
var chart;
nv.addGraph(function() {
var chart = nv.models.multiBarChart()
.reduceXTicks(false) //If 'false', every single x-axis tick label will be rendered.
.rotateLabels(-45) //Angle to rotate x-axis labels.
.showControls(true) //Allow user to switch between 'Grouped' and 'Stacked' mode.
.groupSpacing(0.15) //Distance between each group of bars.
;
chart.xAxis
.tickFormat(function (i) {
return tickValue[i];
});
chart.yAxis
.tickFormat(d3.format(',.1f'));
d3.select('#chart1')
.datum(graph_data)
.call(chart);
return chart;
});
} else {
return <div/>
}
}
tickValue[i]
return Strings wie "Anrufdetails, Einstellungen und legen nahe, Autos zu bekommen".
Ich muss diese Zeichenfolge so umschließen, dass sie in mein Diagramm passt.
Ich habe versucht, mit Wrap-Funktion (https://bl.ocks.org/mbostock/7555321), aber ich bin nicht in der Lage, dies zu tun, wie es für d3 und nicht nvd3 ist.
Vielen Dank.