Legend does not display for Column chart

2 posts, 0 answers
  1. Ande2013
    Ande2013 avatar
    17 posts
    Member since:
    Jun 2013

    Posted 01 Jul 2013 Link to this post


    I have a column chart which does not show the legend even though I have set legend.Visible to true. If I uncomment the .Group line commented in the code below, then the legend starts showing, but unfortunately it displays the default colors rather than those I have customised with m => m.UiColor
                          .Legend(legend => legend
                          .DataSource(ds => ds
                            .Read(read => read
                                .Action("DummyAction", "DummyController")
                            //.Group(g => g.Add(m => m.Status))
                          .Series(series => series.Column(m => m.Count, m => m.UiColor).Name(""))
                          .CategoryAxis(axis => axis
                                                    .Categories(m => m.Status)
  2. Iliana Nikolova
    Iliana Nikolova avatar
    2622 posts

    Posted 02 Jul 2013 Link to this post

    Hello Andreas,

    Thank you for provided your Chart's configuration. Up to your scenarios:

    • Grouped Chart - by design the colorField is intended to set color to a single point in the series (like in this online demo), not to the entire series. Please note the legend's color matches the series color. Hence in order to achieve the expected result you should set colors to the series through the series.color (like here) or the seriesColors (like in this online demo). Another option is to set the color manually via the options
      function onDb(){
        var chart = $("#chart").data("kendoChart");
        chart.options.series[0].color = chart.options.series[0].data[0].UiColor;

    • Non-grouped chart - by design the Chart's legend shows the series' names. In the provided code snippet the series.name is (""). Hence in order to display the legend you should specify the series' name (for example .Name(" ") ).
    Iliana Nikolova
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top