Telerik Forums
UI for ASP.NET MVC Forum
1 answer
70 views

Where can I find the data that is used to feed the demos for charts?  All of the chart demos have calls where I can't really see what data is being fed to the chart.  For example in the Treemap demo:

public ActionResult Index_PopulationUSA()
       {
           return Json(TreeMapDataRepository.PopulationUSAData(), JsonRequestBehavior.AllowGet);
       }

Where can I see the data in TreeMapdataRepository.PopulationUSAData?
Tsvetomir
Telerik team
 answered on 05 Sep 2019
8 answers
124 views

Hello, I have a problem with the treemap component in the MVC project, when it displays an exception :

Unhandled exception at line 122, column 18825 in http://localhost:58298/Scripts/kendo/kendo.all.min.js
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'level'

Index:

@(Html.Kendo().TreeMap()
                .Name("treeMap")
                .DataSource(dataSource => dataSource
                    .Read(read => read.Action("FrekvenceCestujicich", "Dashboard"))
                    .Model(m => m.Children("Items"))
                )
                .ValueField("Value")
                .TextField("Name")
                .HtmlAttributes(new { style = "height:600px; font-size: 12px;" })
)

 

Controller : 

public class DashboardController : BaseController
{
    public ActionResult FrekvenceCestujicich()
    {
        List<Zastavky> zastavky = new List<Zastavky>();
 
        Zastavky mesto = new Zastavky("mesto", 5111856, new List<Zastavky>());
        zastavky.Add(mesto);
        mesto.Items.Add(new Zastavky("Plotní", 166313, null));
        mesto.Items.Add(new Zastavky("Česká", 125917, null));
        mesto.Items.Add(new Zastavky("Celní", 415796, null));
        mesto.Items.Add(new Zastavky("Moravská", 512761, null));
        mesto.Items.Add(new Zastavky("Smetanova", 333111, null));
        mesto.Items.Add(new Zastavky("Náměstí Republiky", 298119, null));
        mesto.Items.Add(new Zastavky("Haškova", 131222, null));
        mesto.Items.Add(new Zastavky("Nerudova", 256771, null));
        mesto.Items.Add(new Zastavky("Dětská nemocnice", 139012, null));
        mesto.Items.Add(new Zastavky("Svatoplukova", 431233, null));
        mesto.Items.Add(new Zastavky("Jana Žižky", 99019, null));
        mesto.Items.Add(new Zastavky("Nová", 76511, null));
        mesto.Items.Add(new Zastavky("Kotlářská", 100988, null));
        mesto.Items.Add(new Zastavky("Mahenova", 188988, null));
        mesto.Items.Add(new Zastavky("U Buku", 36981, null));
        mesto.Items.Add(new Zastavky("Kolmá", 88999, null));
        mesto.Items.Add(new Zastavky("Divadelní", 889231, null));
        mesto.Items.Add(new Zastavky("Koniklecová", 234111, null));
        mesto.Items.Add(new Zastavky("Lesní", 31651, null));
        mesto.Items.Add(new Zastavky("Mrakodrap", 555122, null));
 
        return Json(zastavky, JsonRequestBehavior.AllowGet);
    }
}

 

Model :

public class Zastavky
{
    public Zastavky(string name, int value, List<Zastavky> items)
    {
        Name = name;
        Value = value;
        Items = items;
    }
 
    public string Name { get; set; }
    public double Value { get; set; }
    public List<Zastavky> Items { get; set; }
}

 

Included javascripts :

"jquery.min.js"

"kendo.all.min.js",

"kendo.aspnetmvc.min.js"

Vlastimír
Top achievements
Rank 1
 answered on 12 Nov 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?