Line chart problem

2 posts, 0 answers
  1. Jan Olsmar
    Jan Olsmar avatar
    35 posts
    Member since:
    Mar 2006

    Posted 11 Oct Link to this post

    I have line chart that works well... except when in one serie there is just one value. Then I get wrong values all over... When I add a dummy record it works.

    Do I do something wrong or is this a feature or bug?

     

        @(Html.Kendo().Chart<SignalRDoc.ViewModels.HistoryTot>()
        .Name("linechartteam")
        .Theme("Material")
        .Title("Utfall i procent per månad (Team och konsult)")
         .Legend(legend => legend
            .Position(ChartLegendPosition.Bottom))
        .DataSource(ds => ds.Read(read => read.Action("LineChartTeam", "Statistik"))
    .Group(group => group.Add(model => model.Fnamn))
     
    .Sort(sort => sort.Add(model => model.Period).Ascending())
    )
        .Series(series =>
        {
     
            series.Line(model => model.Procent, categoryExpression: model => model.Period).Name("#= group.value #");      
     
     
        })
            .CategoryAxis(axis => axis
            .Categories(model => model.Period)
     
            .MajorGridLines(lines => lines.Visible(true))
     
     
            .Labels(labels => labels.Format("MMM"))
            )
            .ValueAxis(axis => axis.Numeric()
             .Labels(labels => labels.Format("{0:p1}"))
     
                .Line(line => line.Visible(true))
            )
            .Tooltip(tooltip => tooltip.Visible(true).Shared(true).Format("{0:p1}")
            )
     
     
        )
    </div>

    And the Controller

    public ActionResult LineChartTeam(int? year, string team)
           {
     
               if (year == null)
               {
                   DateTime dt = DateTime.Today;
                   year = dt.Year;
     
               }
               var data = (from p in db.History
                           where p.Period.Year == year
                           where p.Team == team
                           
                           group p by new
                           { p.Fnamn, p.Period }
                          into areaGroup
     
                           
                           select new HistoryTot()
                           {
                                
                               Fnamn = areaGroup.Key.Fnamn,
                               
                               Antal = areaGroup.Sum(p => p.Antal),
                               Budget = areaGroup.Sum(p => p.Budget),
                                
                               Period = areaGroup.Key.Period
                                
     
                           }).ToList();
               return Json(data);
               
           }

  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 13 Oct Link to this post

    Hello Jan Olsmar,

    This question is a duplicate of a support ticket you have sent to us. I will close this forum so that we can continue the conversation in the support ticket as there is more information provided. 

    For anyone else interested: The described behavior has not been reproduced and the issue is still on research phase. 

    Regards,
    Ianko
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top