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

TreeMap not resizing after timer Tick event

3 Answers 38 Views
TreeMap and PivotMap
This is a migrated thread and some comments may be shown as answers.
Gustavo
Top achievements
Rank 1
Gustavo asked on 17 Mar 2015, 08:33 PM
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;
  }
}

3 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 19 Mar 2015, 11:58 AM
Hello Gustavo,

Thank you for the attached code snippets and explanations. I was able to quickly create a new project and reproduce the problematic behavior.

I can confirm that this is a bug in the control. I have logged it here where you can vote and track its status, we will do our best to fix this for the upcoming SP release. I have also updated your Telerik points as a thank you for taking out of your time and helping us improve our products.

The bug is essentially an incorrect if-else clause. You can work around it by creating a new Gdp2 property to set the TooltipPath, so that the TooltipPath, ValuePath and LabelPath properties use different property names:
<telerik:TypeDefinition TargetTypeName="GdpInfo"
  ValuePath="Gdp"
  ToolTipPath="Gdp2" />

Regards,
Petar Marchev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Gustavo
Top achievements
Rank 1
answered on 19 Mar 2015, 12:41 PM
Hi Petar, thanks for help me.
This work around works for the scenario where the size was not updating.
But the color of an item still not updated when changing the value.

<telerik:RadTreeMap Name="xTreeMap" LayoutStrategy="Squarified" BorderThickness="1" BorderBrush="Black" ItemsSource="{Binding DataTags}">
      <telerik:RadTreeMap.TypeDefinitions>
        <telerik:TypeDefinition TargetTypeName="GdpInfo"
                                ValuePath="GdpValue"
                                LabelPath="Country"
                                ToolTipPath="GdpToolTip"
                                ToolTipFormat="{}{0:C0} Mln">
          <telerik:TypeDefinition.Mappings>
            <telerik:ValueBrushColorizer IsAbsolute="True"
                                 ValuePath="GdpColor"
                                 RangeMinimum="0"
                                 RangeMaximum="2000"
                                 Brushes="{StaticResource ColorizerBrushes}" />
          </telerik:TypeDefinition.Mappings>
        </telerik:TypeDefinition>
      </telerik:RadTreeMap.TypeDefinitions>
    </telerik:RadTreeMap>
0
Petar Marchev
Telerik team
answered on 19 Mar 2015, 02:16 PM
Hello Gustavo,

Thank you for the additional information! Indeed the color does not get updated either. I have logged this as a separate bug here. Again we have awarded you some Telerik points as a small token of gratitude.

Regards,
Petar Marchev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TreeMap and PivotMap
Asked by
Gustavo
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Gustavo
Top achievements
Rank 1
Share this question
or