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

Line chart problem

1 Answer 66 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Jan Olsmar
Top achievements
Rank 1
Jan Olsmar asked on 11 Oct 2016, 04:41 PM

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);
           
       }

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 13 Oct 2016, 06:22 AM

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
Tags
Chart
Asked by
Jan Olsmar
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or