Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Legend box - why does the text wrap?
Jeremy Beta
<p>Hi Forum,<br>
<br>
Please can you help me with the attached problem. </p>
<p> </p>
<p>Please just look at the legend in the attached graph, don't consider the other formatting problems with the graph.<br>
<br>
I have tried a lot of different ways of entering the <u>legend </u>in the attached graph, but the text always wraps.<br>
<br>
The size of the graph is set in the before generation macro like this<br>
<br>
beforeGeneration: function(options)<br>
{<br><br>
//Set the chart's size<br>
alert ("Setting chart.width");<br>
options.chart.width=270;<br>
options.chart.height=130;<br>
alert ("Chart.width is now set");<br>
<br>
The current settings for the legend are attached. </p>
<p>
If I make the graph larger then the legend does not wrap!</p>
<p> </p>
<p>Please let me know if you have any ideas.</p>
<p> </p>
<p>Thank you</p>
<p> </p>
<p>Jeremy Beta.</p>
Find more posts tagged with
Comments
Avishak
<p>Hi Jeremy,</p>
<p> </p>
<p>change the Orientation to 'horizontal'. if you want the legend side by side .</p>
<p> </p>
<p>it can be achieved by two ways :</p>
<p>a) changing the Legend Layout Orientation value to 'horizontal' ( default is 'vertical').</p>
<p>b) using script in the setting values in <span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">beforeGeneration for </span>options.legend.layout .</p>
<p> </p>
<p>Thanks,</p>
<p>Avi</p>
Jeremy Beta
<p>Hi Avi</p>
<p>
Thank you for your reply.</p>
<p> </p>
<p>However I would like each entry in the legend to be on one line. Please see the attached screen shot.</p>
<p>
Thanks and kind regards</p>
<p> </p>
<p>Jeremy B</p>
Avishak
<p>So in that can make the Orientation to <strong>vertical </strong>instead of <strong>Auto</strong>.</p>
Jeremy Beta
<p>Hi All</p>
<p> </p>
<p>Sorry, this hasn't worked. The legend is still wrapping. Perhaps this is an HTML5 or HighCharts issue?</p>
<p> </p>
<p>Kind regards</p>
<p> </p>
<p>Jeremy B.</p>
Clement Wong
<p>Try the following setting of percentWidth (which doesn't show on auto complete of options.legend):</p>
<pre class="_prettyXprint">
beforeGeneration: function(options)
{
options.legend.percentWidth = "100%";
},
</pre>