tooltip - How to wrap legend items in highcharts -



tooltip - How to wrap legend items in highcharts -

i have big problem using highcharts, cause have been trying hours wrap legend items if very long. tryed set legend , legend item width, text still out legend. thing found alter highcharts.src.js think that's not way solve problem. here code:

<script type="text/javascript"> var chart; $(document).ready(function() { chart = new highcharts.chart({ chart: { renderto: 'graph_container', defaultseriestype: 'line', zoomtype: 'y', marginright: 130, marginbottom: ${marginbottom} }, title: { x: -10, text: null }, xaxis: { title: { text: '<fmt:message key="html.time" bundle="${msg}"/>', align: 'high' }, categories: [${years}] }, yaxis: { title: { text: '<fmt:message key="html.value" bundle="${msg}"/>', align: 'high' }, plotlines: [{ value: 0, width: 1, color: '#808080' }] }, tooltip: { style: { fontsize: '9pt', width: '400px',//, wrap:'hard' }, formatter: function() { homecoming '<b>' + this.series.name + '<br>' + + this.x +': '+ this.y + '</b>'; } }, legend: { layout: 'vertical', width: 600, floating: true, align: 'center', verticalalign: 'bottom', borderwidth: 1, itemwidth: '500px' }, credits: { enabled: false }, exporting: { enabled: false }, series: [ <c:foreach items="${graphvalues}" var="value" varstatus="counter"> <c:if test="${counter.count != 1}">,</c:if> { name: '${value.name}', data: ${value.jsondata} } </c:foreach> ] }); }); </script>

edit: setting item width did work, improve solution.

setting itemwidth doesn't work me, can this:

labelformatter: function() { var words = this.name.split(/[\s]+/); var numwordsperline = 4; var str = []; (var word in words) { if (word > 0 && word % numwordsperline == 0) str.push('<br>'); str.push(words[word]); } homecoming str.join(' '); }

see http://jsfiddle.net/armrm/13520/ example.

tooltip wrap highcharts legend

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -