Legend Width / Legend items cut off

5 posts, 0 answers
  1. Juan Sola
    Juan Sola avatar
    26 posts
    Member since:
    Jan 2007

    Posted 18 Jun 2012 Link to this post

    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?
  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 20 Jun 2012 Link to this post

    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!
  3. Jordana
    Jordana avatar
    4 posts
    Member since:
    Feb 2012

    Posted 12 Jul 2012 Link to this post

    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
  4. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 16 Jul 2012 Link to this post

    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!
  5. Oscar
    Oscar avatar
    1 posts
    Member since:
    Oct 2012

    Posted 19 Oct 2012 Link to this post

    And could you put only one label by file in the legend with bottom position?
Back to Top