Telerik Forums
UI for Silverlight Forum
9 answers
113 views
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
Petar Mladenov
Telerik team
 answered on 02 Jun 2017
1 answer
44 views
How to add colors in RadPivotMap? the example shows using the gdp data on RadTreeMap... There is no proper documentation on adding color to RadpivotMap.
Please do help with example to add color to RadpivotMap    
Petar Mladenov
Telerik team
 answered on 25 May 2015
3 answers
34 views
After Timer Tick event the value in the ToolTip is updated but the size and the color don't.

<UserControl x:Class="TreeMapSLTest.MainPage"
        mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
   
  <UserControl.Resources>
    <SolidColorBrush Color="#FFE10000" x:Key="Hundred" />
    <SolidColorBrush Color="Orange" x:Key="ThreeHundred" />
    <SolidColorBrush Color="LightBlue" x:Key="FiveHundred" />
    <SolidColorBrush Color="Blue" x:Key="SevenHundred" />
    <SolidColorBrush Color="DarkBlue" x:Key="Thousand" />
    <SolidColorBrush Color="Green" x:Key="TwoThousand" />
 
    <telerik:RangeBrushCollection x:Key="ColorizerBrushes">
      <telerik:RangeBrush Brush="{StaticResource Hundred}" From="0" To="100" />
      <telerik:RangeBrush Brush="{StaticResource ThreeHundred}" From="101" To="300" />
      <telerik:RangeBrush Brush="{StaticResource FiveHundred}" From="301" To="500" />
      <telerik:RangeBrush Brush="{StaticResource SevenHundred}" From="501" To="700" />
      <telerik:RangeBrush Brush="{StaticResource Thousand}" From="701" To="1000" />
      <telerik:RangeBrush Brush="{StaticResource TwoThousand}" From="1001" To="2000" />
    </telerik:RangeBrushCollection>
  </UserControl.Resources>
   
  <Grid x:Name="LayoutRoot">
    <telerik:RadTreeMap Name="xTreeMap" LayoutStrategy="Squarified" BorderThickness="1" BorderBrush="Black" ItemsSource="{Binding DataTags}">
      <telerik:RadTreeMap.TypeDefinitions>
        <telerik:TypeDefinition TargetTypeName="GdpInfo"
                                ValuePath="Gdp"
                                LabelPath="Country"
                                ToolTipPath="Gdp"
                                ToolTipFormat="{}{0:C0} Mln">
          <telerik:TypeDefinition.Mappings>
            <telerik:ValueBrushColorizer IsAbsolute="True"
                                 ValuePath="Gdp"
                                 RangeMinimum="0"
                                 RangeMaximum="2000"
                                 Brushes="{StaticResource ColorizerBrushes}" />
          </telerik:TypeDefinition.Mappings>
        </telerik:TypeDefinition>
      </telerik:RadTreeMap.TypeDefinitions>
    </telerik:RadTreeMap>
  </Grid>
</UserControl>

void m_timer_Tick(object sender, EventArgs e)
{
  foreach (GdpInfo gdp in DataTags)
  {
    if (gdp.Country == "Brazil")
      gdp.Gdp -= 25;
  }
}
Petar Marchev
Telerik team
 answered on 19 Mar 2015
2 answers
47 views
I use TreeMap with CustomMapping that marks selected items with an image (see att)

When loading Data, it works, but how can i change property of DataModel so it would invoke Apply() method of CustomMapping?

I mean, when the property of DataItem is changed, i'd like to check it again in Apply() method of CustomMapping.

Thanks

Was
Top achievements
Rank 1
 answered on 19 Sep 2014
10 answers
149 views
How to I get the selectec TreeMapItem of a Rad Tree Map in code so I can set IsSelected to false?  Best I have been able to do is get the Selected Item that is backing the node but not the node itself.

I have this:

<telerik:RadTreeMap x:Name="TreeMap"
                    IsSelectionEnabled="True"
                    ItemsSource="{Binding ChartItems}"
                    LayoutStrategy="Squarified" >
 
    <telerikControl:EventToCommandBehavior.EventBindings>
        <telerikControl:EventBinding EventName="SelectionChanged"
                                     Command="{Binding ShowDataCommand}"
                                     PassEventArgsToCommand="True"/>
    </telerikControl:EventToCommandBehavior.EventBindings>
     
    ..............
    ..............
 
</telerik:RadTreeMap>

The argument (SelectionChangedRoutedEventArgs) gets passed properly but the SelectedItem is the object from the ChartItems collection that has the backing data and not the "RadTreeMapItem" which, I presume, is what I need to unselect it.  In other works, this works:

SelectedChartItem = args.SelectedItem as ChartItem;

but this does NOT:

var SelectedTreeMapItem = args.SelectedItem as RadTreeMapItem;

I assume (hope) that the item is buried somewhere else in the argument object?

Thanks
Ernie
Ernie S
Top achievements
Rank 1
 answered on 14 Aug 2014
2 answers
56 views
I have an MVVM setup that is using both PieCharts and TreeMaps.  I am able to bind the RadLegend directly to the PieChart without issue.  I can apply a template that, among other things, can consume the Marker Symbol / Color the pies are drawn with in the Legend using a template like so:

01.<DataTemplate x:Key="LegendItemButtonDataTemplate">
02.    <Button HorizontalAlignment="Stretch"
03.            VerticalAlignment="Center"
04.            Command="{Binding DataContext.ShowDataCommand, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
05.            CommandParameter="{Binding }">
06.        <Button.Template>
07.            <ControlTemplate>
08.                <StackPanel Orientation="Horizontal"
09.                            Background="Transparent">
10.                    <Rectangle Fill="{Binding MarkerFill}"
11.                               Width="10" Height="10" />
12.                     
13.                    <TextBlock Text="{Binding Title, TargetNullValue='{}{NONE}'}"
14.                               Margin="10,1,5,1"/>
15.                     
16.                    <TextBlock Text="{Binding Presenter.Value, StringFormat='({0:C0})'}"
17.                               Margin="5,1" />
18.                </StackPanel>
19.            </ControlTemplate>
20.        </Button.Template>
21.    </Button>
22.</DataTemplate>

Ignoring everything else, line 10 shows the binding so that the custom template shows the color of the pie in the legend.

I would like to reproduce this ability for the RadTreeMap which, as far as I know, does NOT support directly binding to the Legend.  So I created a Collection in the ViewModel of IEnumerable LegendItems and manually fill it like so:

1.<telerikControl:RadLegend Items="{Binding LegendItems}"
2.                          ItemTemplate="{StaticResource LegendItemButtonDataTemplate}"
3.                          Foreground="White"
4.                          Margin="10"
5.                          HorizontalAlignment="Left"
6.                          VerticalAlignment="Top"
7.                          HoverMode="FadeOtherItems"/>


01.var legenditems = new LegendItemCollection();
02.legenditems.AddRange(
03.    distinctlist.Select(ci =>
04.    {
05.        var legenditem = new LegendItem
06.        {
07.            Title = ci.Label,
08.            MarkerFill = ????????,
09.            Presenter = ci
10.        };
11.        return legenditem;
12.    })
13.);
14. 
15.LegendItems = legenditems;

Line 8 is the problem in that last section.  ci are the objects in the VM that contain the label and value data.  But since the TreeMap generates the colors in XAML like this:

01.<telerik:RadTreeMap.TypeDefinitions>
02.    <telerik:TypeDefinition TargetTypeName="ChartItem"
03.                            LabelPath="Label"
04.                            ValuePath="Value"
05.                            ToolTipPath="Value"
06.                            ToolTipFormat="{}{0:#,###.00}"
07.                            ItemTemplate="{StaticResource itemTemplate}">
08.         
09.        <telerik:TypeDefinition.Mappings>
10.             
11.            <telerik:RelativeValueGradientColorizer>
12.                <GradientStop Offset="0" Color="DarkGreen" />
13.                <GradientStop Offset="1" Color="LightGreen" />
14.            </telerik:RelativeValueGradientColorizer>
15.             
16.        </telerik:TypeDefinition.Mappings>
17.         
18.    </telerik:TypeDefinition>
19.</telerik:RadTreeMap.TypeDefinitions>

how do I access the the color used in the ViewModel?  I do not see an obvious way in the RadLegend members. 

Thanks
Ernie
Ernie S
Top achievements
Rank 1
 answered on 05 Aug 2014
1 answer
73 views
I would like to use the Telerik RadTreeMap control with Tooltip and I need to display a complex tooltip, similar to the following example:
http://demos.telerik.com/silverlight/#Treemap/FirstLook

How can I bind a complex tooltip with image to the RadTreeMap control? Could you show an example with source code?

Thanks your assistance in advance!
Yavor
Telerik team
 answered on 06 Mar 2014
2 answers
51 views
Dear Telerik support,

I am using telerik.windows.controls.datavisualization version 2012.3.1129.1050 with silverlight 5.  I am trying to use pivot map inside a popup user control.  Pivotmap does not display inside a popup control but it works fine if I change my user control to be default rootvisual in app.xaml.cs.

Is this functionality by design?

Thanks.
Syed
Top achievements
Rank 1
 answered on 16 Oct 2013
0 answers
35 views
 
Denison
Top achievements
Rank 1
 asked on 26 May 2013
11 answers
71 views
Telerik Silverlight Tererik Treemap needs mininum which version of Silverlight, is Silverlight 4 enough? else need Silverlight 5?

Vlad
Telerik team
 answered on 21 Jan 2013
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?