This is a migrated thread and some comments may be shown as answers.

Treemap features

9 Answers 58 Views
TreeMap and PivotMap
This is a migrated thread and some comments may be shown as answers.
MohanRajP - PmR
Top achievements
Rank 1
MohanRajP - PmR asked on 14 Aug 2012, 09:17 AM
Hi,
 Telerik treemap supporting these below features
1. Color can get from legend or any other control it should be supplied by user selection (code behind)
2. Label item can be contain two items (like hyperlink and image)
3. Each item can have click event
4. Colorizer min and max value can be supplied in code behind

Thanks & Regards,
MohanRajP

9 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 17 Aug 2012, 08:23 AM
Hello Mohan,

1) You can use our ValueGradientColorizer. It is a colorizer, which contains a set of GradientStops. It chooses the brush to be applied according to the RadTreeMapItem's value and colorizer's gradient stops. Each GradientStop.Offset value can be absolute or relative (between 0 and 1) depending on the IsAbsolute property value. 

2) RadTreemap allows you to specify a custom item template for your nodes (items with children) and your leaves (items without children). In your TypeDefinition add ItemTemplate like this: 

<telerik:TypeDefinition TargetTypeName="Folder" ValuePath="Size" LabelPath="Name" ChildrenPath="Children" ToolTipPath="Size">
    <telerik:TypeDefinition.ItemTemplate>
        <telerik:HierarchicalDataTemplate ItemsSource="{Binding Children}">
            <HyperlinkButton Content="{Binding Label}" />
        </telerik:HierarchicalDataTemplate>
    </telerik:TypeDefinition.ItemTemplate>
</telerik:TypeDefinition>
Now all of the Folders will use a hyperlink button to display their label.

3) You can enable selection by setting the IsSelectionEnabled to True and hooking up the SelectionChanged event.

4) All colorizers can be created and set-up in code behind.  Kind regards,
Yavor
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
MohanRajP - PmR
Top achievements
Rank 1
answered on 10 Sep 2012, 03:56 PM
Hi Yavor,
 I have a class and properties of
parent
name
nodetype
weightage
metricvalue

service returns a collections of those, contains nodetype of 2 items Equipment and Target

I have to bind those two different Items to Treemap with two different typedefinitions.
how to bind thorugh from viewmodel context


Regards,
MohanRajP
0
Yavor
Telerik team
answered on 13 Sep 2012, 08:26 AM
Hi Mohan,

You can describe the types you want to bind to in your xaml. If you have 2 types that you want to be displayed in your treemap then you need 2 type definitions - 1 for each different type (like the file - folder scenario). Then you can feed your treemap with data from your view model.

I have prepared a small sample app that demonstrates this approach. It shows the file - folder scenario in action.

Kind regards,
Yavor
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
MohanRajP - PmR
Top achievements
Rank 1
answered on 14 Sep 2012, 05:02 AM
Hi,
 I add same colorizer for two diff typedefinition like

 

 

this.AssetTreeMap.TypeDefinitions[0].Mappings.Add(colorizer1);
this.AssetTreeMap.TypeDefinitions[1].Mappings.Add(colorizer1);

but its not working both, only one working.

why and how to apply diff typedefintions same colorizer at run time

please reply asap

 

0
Yavor
Telerik team
answered on 18 Sep 2012, 08:48 AM
Hi Mohan,

Mappings are bound to the type they are declared on (from the type definition). In other words they map a certain type (Folder, File, etc) to something else (color, gradient brush, etc). This means that you cannot use the same mapping for 2 type definitions. What happens is that the last type definition owns the mapping for its type.

You can fix this issue by creating a separate mapping for each type definition.

All the best,
Yavor
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
MohanRajP - PmR
Top achievements
Rank 1
answered on 15 Oct 2012, 12:28 PM
Hi Yavor,
 Thank you for your support and helping.
I need a exact sample of Treemap Selection demo sample. But I need to bind dynamic collection instead of hard coded.
Can you send me a sample asap.

Regards,
MohanRajP
0
Yavor
Telerik team
answered on 17 Oct 2012, 07:44 AM
Hi Mohan,

The source code of the demos is available for download from your account page. In this particular demo the treemap is bound to a static collection of data. You can easily change that by making the collection observable so that the treemap can listen for updates. Another approach, although it is not recommended because it is slower, is to change the ItemsSource of the treemap.

All the best,
Yavor
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Mingxue
Top achievements
Rank 1
answered on 01 Jun 2017, 12:54 AM

Hi,

I have to borrow from this thread because the website hangs and doesn't load when I tried to create a new ticket. We are using PivotMap to display some data, and PivotMap is constantly invoking exceptions to the UI thread for:

==============================================================================

Cannot call Arrange on a UIElement with infinite size or NaN. Parent of type 'Telerik.Windows.Controls.TreeMap.TreeMapPanel' invokes the UIElement. Arrange called on element of type 'Telerik.Windows.Controls.TreeMap.RadTreeMapItem'.

==============================================================================

An easy test is to give two data, one with float.Max / 2, and another is to give a 0.0001, this will repro.

My question is:

1. What is the largest number that TreeMap/PivotMap can support?

2. Should I normalize my data before giving it to TreeMap/PivotMap?

3. Even if I normalize my data, I could still run into issues where a comparatively large number say float.Max/2 comparing 0.0001. What should I do?

4. Is negative number supported? The TreeMap/PivotMap automatically order the items based on the size/magnitude, but if I have both positive and negative numbers that I want to view in TreeMap/PivotMap, how can I ask TreeMap/PivotMap to order them based on the actual value?

0
Petar Mladenov
Telerik team
answered on 02 Jun 2017, 10:50 AM
Hi Mingxue,

Regarding the exception and Question 1, can you send us more code so we can replicate this on our side  and advice more precisely. You can change some of our SDK samples if this is more convenient for you.

As for the negative values  (questions 2-4). They are not directly supported in terms that there is no good way to visualize area representing negative value. For that purpose Bar Chart with bars below 0 and bars above 0 are better visual representation. However you might need to visualize area for one property but also indicate other negative / positive values for the same business object. If this is the case, you can take a look at our AbsoluteValueBrushColorizer (check its detailed description on the left, the code for WPF is actually pretty similar).

Regards,
Petar Mladenov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
TreeMap and PivotMap
Asked by
MohanRajP - PmR
Top achievements
Rank 1
Answers by
Yavor
Telerik team
MohanRajP - PmR
Top achievements
Rank 1
Mingxue
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or