0

モデルのデータを剣道棒グラフに表示するのに苦労しています。次の図に示すように、棒グラフに結果を表示したい

ここに画像の説明を入力

コントローラーは有効なデータを返しますが、チャートはデータを正しく表示できません。

モデルは

public class FeeCollectionViewModel
 {
     [Key]
     public int FeeCollectionID { get; set; }
     public int StudentID { get; set; }
     public int FeeModeID { get; set; }
     public int FeeTypeID { get; set; }
     public string FeeTypeName { get; set; }
     public double Amount { get; set; }
     public DateTime CollectionDate { get; set; }
  }

これがビューです

@using Kendo.Mvc.UI
@using Kendo.Mvc.Extensions
@{
    ViewBag.Title = "Fee Statistics";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Fee Statistics</h2>

 @(Html.Kendo().Chart<SMS.ViewModels.FeeCollectionViewModel>()
        .Name("chart")
        .Title("Today's Collection")
        .Legend(legend => legend
        .Position(ChartLegendPosition.Top)
        )
        .DataSource(ds => ds
            .Read(read => read.Action("TodaysCollection_Read", "FeeCollections"))
            .Group(group => group.Add(model => model.FeeTypeName))
        )
        .Series(series =>
        {
            series.Column(model => model.Amount).Name("Amount Collected");
        })
        .CategoryAxis(axis => axis
            .Categories(model => model.FeeTypeName)
            .Labels(labels => labels.Rotation(-90))
            .MajorGridLines(lines => lines.Visible(false))
        )
        .ValueAxis(axis => axis.Numeric()
            .Labels(labels => labels.Format("{0:N0}"))
            .MajorUnit(10000)
            .Line(line => line.Visible(false))
        )
        .Tooltip(tooltip => tooltip
            .Visible(true)
            .Format("{0:N0}")
        )
)
4

2 に答える 2