This is a migrated thread and some comments may be shown as answers.

Legend Width / Legend items cut off

4 Answers 370 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Sitefinity
Top achievements
Rank 1
Sitefinity asked on 18 Jun 2012, 04:48 PM
Maybe I missed this in the documentation but can I declare the absolute width for the legend? It does not seem to work well with my defined width of the chart and items get cut off. How does the legend decide when to drop items to another line? Can I control this?

4 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 20 Jun 2012, 08:34 AM
Hi Juan,

I am afraid you can not set a width to the legend in Kendo UI Chart, but as a possible workaround I would suggest to configure its margin and padding. This way you could specify the place the legend takes. For example:
$("#chart").kendoChart({
// ...
 legend: {
    padding: (0, 95, 0, 45),
    margin: 55,
    position: "right"
 },
// ...
});

I hope this helps.

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jordana
Top achievements
Rank 1
answered on 12 Jul 2012, 02:49 PM
I would love to see text wrap or a maximum width for chart legends as well.   I have my margins and padding set to zero but my legend is wider than my pie chart.  (My requirements specify legend to the right of the chart).

Thanks!
Jordana
0
Iliana Dyankova
Telerik team
answered on 16 Jul 2012, 07:42 AM
Hello Jordana,

As I said in my previous post, setting width to the chart legend is not supported in Kendo UI DataViz. The configuration of margins and paddings is not mandatory, but currently this is the most suitable workaround for specifying the place that the legend takes. For convenience, I prepared a small example which illustrates such approach in action.

 

Kind regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Oscar
Top achievements
Rank 1
answered on 19 Oct 2012, 01:27 PM
And could you put only one label by file in the legend with bottom position?
Tags
Charts
Asked by
Sitefinity
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Jordana
Top achievements
Rank 1
Oscar
Top achievements
Rank 1
Share this question
or