Controlling Chart Legend Font

3 posts, 1 answers
  1. sara
    sara avatar
    31 posts
    Member since:
    May 2007

    Posted 20 Mar 2012 Link to this post

    I am attempting to change the font size of the legend using the following:
    legend: {
        visible: true,
        position: "top",
        margin: 5,
        padding: 2,
        font: "8px Arial"
    }

    According to your demos: http://demos.kendoui.com/dataviz/bar-charts/index.html
    Under Configuration > legend it shows a font property as a string, as I did above.  However, when I do this, the font size does not change (additionally, I am unable to change the font family).  I noticed in one of the forum posts that someone did:
    legend: {
        visible: true,
        position: "top",
        margin: 5,
        padding: 2,
        labels: {
            font: "10px Verdana"
        }
    }

    This seems to work much better.  Is this a typo or an undocumented API change?

    Thanks,
    Sara
  2. Answer
    Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 22 Mar 2012 Link to this post

    Hello Sara,

    Thank you for the feedback. Actually, we have missed to add  this in our documentation, but we will amend it.

    I have also updated your telerik points as token of gratitude.  


     All the best,

    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. Kendo UI is VS 2017 Ready
  4. RUBEN
    RUBEN avatar
    8 posts
    Member since:
    Dec 2013

    Posted 04 Jun 2015 in reply to sara Link to this post

    In MVC mode, I use:

    .Legend(legend => legend
      .Position(ChartLegendPosition.Bottom).Labels(x => x.Font(font: "9px Arial,Helvetica,sans-serif"))
    )
Back to Top