Telerik Forums
Kendo UI for jQuery Forum
4 answers
171 views

Hi,

I have a problem setting correctly the treemap.

Everything works now, but I would like to change some tile aspect based on the tile properties (name, value).

This is my actual implementation:

("#treemap").kendoTreeMap({
dataSource: datasource,
autoBind: true,
valueField: "value",
textField: "name",
colorField: "color",
type: treemaptype,
itemCreated: function (e) {   

                            },
dataBound: function (e) {
// Total + Groups
if (e.node) {
var element = this.findByUid(e.node.uid);
element.css("background-color", e.node.color);
// to set back the original color
}
}
}).on("click", ".k-leaf, .k-treemap-title", function (e) {
var item = $("#treemap").data("kendoTreeMap").dataItem($(this).closest(".k-treemap-tile"));

alert(item.name)
});

I have understood that itemCreated event cannot be used, because data are not yet bound to the item, and we can only change some css property.

In ASP we can implement a Server-side procedure to do that.

What I can do in MVC ?

Thank you

Banca del Ceresio
Top achievements
Rank 1
 answered on 13 Nov 2015
1 answer
53 views

Hi,

 I have created a treemap, assigning color to each tile, but if a tile is a header, the color is overidden.

There is a way to force a header color ?

 As you can see, I have put an alert in itemCreated event, to stop after each tile creation, and as you can see in the first attached file, the tile have the color that I chose.

When the child tiles are created, the parent tile color is overidden (see attached file 2).

 Thank you for you help

 

 

Daniel
Telerik team
 answered on 06 Nov 2015
7 answers
160 views

Hi,

 I am currrently evaluating the TreeMap control. I am interested in using it in an AngularJS application. I could not find much documentation on the API. The following link leads to a 404 error. http://www.telerik.com/support/code-library/kendo-ui/treemap

 

Basically I would like to know if I customize the template of each cell. Rather than having only one label in each cell, could I have a few labels, each with different font and size?

Is there a click event? When a user clicks on a cell, I'd like that to be directed to another page.

I could only see a basic usage of the Treemap. Is there an advanced sample available?

Thanks,

Chris

Daniel
Telerik team
 answered on 04 Nov 2015
3 answers
132 views

Hi There,

I am new to kendo UI, I am struggling to bind dynamic data to treemap. I could not able to find example on forum

 Controller returns:

Json(treeMap, JsonRequestBehavior.AllowGet);​ object of following class

public class TreeMapData

{

 

      public int ParameterID{...}
      public string ParameterName{...}
      public double ParameterWeight{...} 
      //public string ParameterStatus
      public List<TreeMapData> ParameterChilds{..}
      //public string ParameterTooltip{...}
      public bool HasChild { get { return  ParameterChilds.Count > 0?true:false;    }
}

 

 

View:

<script type="text/javascript">
    function createTreeMap() {
        $("#treeMap").kendoTreeMap({
            dataSource: {
                transport: {
                    read: {
                        url: '@Html.Raw(Url.Action("GetAnalysisData", "Analysis", ""))',
                        dataType: "json"
                    }
                },
                schema: {
                    model: {
                        parameterid: "ParameterID",
                        parametername: "ParameterName",
                        parameterwieght: "ParameterWeight",
                        hasChildren: "HasChild",
                        children: "ParameterChilds"
                    }
                }
            },
            textField: "parametername",
            valueField: "parameterwieght"
        });       
    }

    $(document).ready(function () {
        createTreeMap();
        $(document).bind("kendo:skinChange", createTreeMap);
    });
    
    </script>​

 

Error : Microsoft JScript runtime error: Object doesn't support property or method 'slice'.

When i bind status data, it perfectly works fine.

 

Boyan Dimitrov
Telerik team
 answered on 24 Aug 2015
1 answer
47 views

The treemap is only showing data that is set first. When I change the options, the widget still displays the old data.

http://dojo.telerik.com/ifEWA/2

Then I thought I will try just changing the data on the datasource but that did not work either.

http://dojo.telerik.com/exUtI

 

What is the right way of using a treemap to display different sets of data? My schema is the same.

 

Thanks.

Daniel
Telerik team
 answered on 19 Aug 2015
1 answer
1.2K+ views

The following examples fails to run

http://dojo.telerik.com/UXOyu/2

when I add children to items using push.

 If I use a static object like

            data: [{
                name: "Tree",
                value: 5,
              items:[
                {
                  name:"Leaf 1"
                  value:3
                },
                {
                  name:"Leaf 2"
                  value:2
                }
                ]
            }],

 It works fine.

What am I missing?

 

Thanks.

 

 

 

 

Alexander Popov
Telerik team
 answered on 12 Aug 2015
3 answers
112 views

Hi,

My treemap seems to bind to the data but shows like a flat line as if the individual boxes don't get a width attributed to them.

The treemap as a whole does have ample space through but it fills it up with pure white nothingness (as you can see in the screenshot).
If I try the same thing (same data) with the same version of kendo on the demo page (http://dojo.telerik.com/ohOKA/2) it works just fine but somehow it doesn't show correctly on my own website.

 Anyone have an idea what might cause this?

 btw I'm using angularJS implementation of the treemap.

 thanks,

Arno

 

Daniel
Telerik team
 answered on 22 Jul 2015
2 answers
81 views
I am trying to wire a kendo TreeMap to a webservice. I have set up a
demo in my project. When I run it, the TreeMap doesn't just evoke it
once, it goes nuts and evokes in in an infinite loop!

I'd love to get this control in my app. Please help.






<div role="gridcell" class="container">
    <div id="treeMap" style="height: 600px; font-size: 12px;"></div>
</div>
 
<script>
 
    $(document).ready(function() {
        createTreeMap();
    });
 
    function createTreeMap() {
        $("#treeMap").kendoTreeMap({
            dataSource: dataSource ,
            valueField: "value",
            textField: "name"
        });
    }
 
 
 
var dataSource = new kendo.data.HierarchicalDataSource({
    schema: {
        data: function (result) {
            return result.d || result;
        },
    },
    transport: {
        read: {
            url: "../WebServices/ItemWebService.asmx/TreeMapA",
            contentType: "application/json; charset=utf-8",
            type: "POST"
        },
        parameterMap: function (data, operation) {
            switch (operation) {
                case "read":
                    return JSON.stringify({ itemId: -1, SSID: globalValues.ssid })
                    break;
            }
        }
    }
});
 
</script>


Public Class ItemWebService
Inherits AppWebservice
 
 
Public Class TreeMapItem
    Public Property name As String
    Public Property value As Decimal
    Public Property items As List(Of TreeMapItem)
 
    Public Sub New()
 
    End Sub
 
    Public Sub New(name As String, value As Decimal)
        _name = name
        _value = value
        '_items = List(Of TreeMapItem)()
    End Sub
 
 
End Class
 
<WebMethod()> _
Public Function TreeMapA(itemId As Integer, SSID As Integer) As List(Of TreeMapItem)
    Try
        Dim retValue As New List(Of TreeMapItem)
 
        retValue.Add(New TreeMapItem("Part A", 89))
        retValue.Add(New TreeMapItem("Part B", 233))
        retValue.Add(New TreeMapItem("Part B", 90))
 
        Return retValue
 
    Catch ex As Exception
        Throw ex
    End Try
End Function





Jeremy
Top achievements
Rank 1
 answered on 18 Feb 2015
1 answer
83 views
As per the documentation found here (http://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/treemap#configuration-valueField) , the default data item field for textField, valueField and colorField are "text", "value", "color" respectively. However, when I do not specify the field name, the default values are not chosen. 

I have reproduced this over here : http://dojo.telerik.com/ahejo .
In the above exmaple, the treemap works, when I un-comment the 3 lines for textField, valueField and colorField, but not otherwise. 

Am I missing something, or is it a bug?

Thanks,
Abhishek
Hristo Germanov
Telerik team
 answered on 31 Oct 2014
3 answers
111 views
Do you have any examples with treemaps with hover tooltip style windows - that can for example show the underlying values, or more details behind the item

Thanks
Hristo Germanov
Telerik team
 answered on 23 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?