Kendo UI treemap json binding

I am trying to create a very simple treemap (without hierarchy) using KendoUI by providing it with some json data as a data source. This should have been very simple and simple, as this is a common use case. However, I was not lucky with this, spending hours on it.

I tried this:

<body>
<div id="treemap"></div> 
<script> 
var data = [
    {
    name: "foo123",
    value: 10
    },
    {
    name: "foo234",
    value: 20
    }
   ];
$("#treemap").kendoTreeMap({
dataSource: data,
valueField: "value",
textField: "name"
});
</script>
</body>

Any suggestions on what I might lose?

+4
source share
1 answer

As stated in the docs "TreeMap is a visualization for hierarchical":

TreeMapping - , . ,

, "" , :

<body>
    <div id="treemap"></div>
    <script>
        var data = [{
            name: "foo",
            value: 1,
            items: [{
                name: "foo123",
                value: 10
            },
            {
                name: "foo234",
                value: 20
            }]
        }];
        $("#treemap").kendoTreeMap({
            dataSource: data,
            valueField: "value",
            textField: "name"
        });
    </script>
</body>
+4

All Articles