0

I have the folling code:

        @(Html.Kendo().Chart(Model.ListCa).Name("chart1")
    .Title("Chiffre d'affaire par Service et par mois durant l'année " + Model.Year + "")
    .SeriesDefaults(seriesDefaults => seriesDefaults.RadarLine().Style(ChartRadarLineStyle.Smooth)).Series(series => {
        series.RadarLine(model => model.General).Color("#6E6AEB");
        series.RadarLine(model => model.SE).Color("#848484");
        series.RadarLine(model => model.SL);
        series.RadarLine(model => model.TI).Color("#B40404");
        series.RadarLine(model => model.PI);
        series.RadarLine(model => model.SG).Color("#9de219");
        series.RadarLine(model => model.DA).Color("#0080FF");
        series.RadarLine(model => model.RSC);
        series.RadarLine(model => model.CTC);
        series.RadarLine(model => model.FR);
        series.RadarLine(model => model.CEE).Color("#58FAF4");
        series.RadarLine(model => model.HA);
        series.RadarLine(model => model.AB);
    })
    .CategoryAxis(axis => axis
        .Categories(model => model.Month)
    )
    .ValueAxis(axis => axis.Numeric()
        .Labels(labels => labels.Template("$#= value / 1000 #k"))
    )
) 

when i add the following line SeriesDefaults(seriesDefaults => seriesDefaults.RadarLine().Style(ChartRadarLineStyle.Smooth)) in the code it generates the error:

CS1593: Delegate Action does not take 0 arguments.

And when i remove it the chart doesn't work correctly.

teo van kot
  • 12,350
  • 10
  • 38
  • 70

1 Answers1

0

I reproduce your chart in my MVC4 project. I have created this model as data:

public class Category
{
    public decimal General { get; set; }
    public decimal SE { get; set; }
    public decimal SL { get; set; }
    public decimal TI { get; set; }
    public decimal PI { get; set; }
    public decimal SG { get; set; }
    public decimal DA { get; set; }
    public decimal RSC { get; set; }
    public decimal CTC { get; set; }
    public decimal FR { get; set; }
    public decimal CEE { get; set; }
    public decimal HA { get; set; }
    public decimal AB { get; set; }
    public string Month { get; set; }

    public Category(string Mon)
    {
        General = 20.0m;
        SE  = 1.0m;
        SL  = 2.0m;
        TI  = 3.0m;
        PI  = 4.0m;
        SG  = 5.0m;
        DA  = 6.0m;
        RSC = 7.0m;
        CTC = 8.0m;
        FR  = 9.0m;
        CEE = 10.0m;
        HA = 11.0m;
        AB = 12.0m;
        Month = Mon;
    }
};

public class ChartViewModel
{
    public List<Category> ListCa { get; set; }
    public DateTime Year { get; set; }

    public ChartViewModel()
    {
        ListCa = new List<Category>();
        ListCa.Add(new Category("Jan"));
        ListCa.Add(new Category("Feb"));
        ListCa.Add(new Category("Mar"));
        ListCa.Add(new Category("April"));
        ListCa.Add(new Category("May"));
        ListCa.Add(new Category("June"));
    }
};

And everthing works perfectly. Even when I have add to chart this line:

.SeriesDefaults(seriesDefaults => seriesDefaults.RadarLine().Style(ChartRadarLineStyle.Smooth))

second time or change it. So this is not a problem with this code.

Plese check if you have latest Kendo version (Q3 2014) and if you use correct MVC4 dll.

If you just started using KendoUI check if you instal everything correctly. Here is tutorial how to do it: http://docs.telerik.com/kendo-ui/aspnet-mvc/asp-net-mvc-4

Finnaly, tell me if your model looks different than mine.

Jarosław Kończak
  • 3,387
  • 2
  • 19
  • 36