Version

Working with ScaleBreaks Collection

The xamTagCloud™ control contains a ScaleBreak collection which allows you to group a range of weight values on the same scale break. For example, if you have a large collection of cloud items with a significant range of weight values, you could create a scale break to apply the same weight to all cloud items with a weight ranging from 1 to 50.

Each ScaleBreak contains the following properties:

  • StartWeight – this specifies the start range of weight value you want to apply the scale break to

  • EndWeight – this specifies the end range of weight values you want to apply the scale break to

  • Weight – this specifies the weight you want to apply to the range of weight values specified by the StartWeight and EndWeight properties.

The following code demonstrates how set scale breaks.

In XAML:

<ig:XamTagCloud MaxScale="5" MinScale="1" x:Name="myTagCloud">
   <ig:XamTagCloud.ScaleBreaks>
      <ig:ScaleBreak StartWeight="1" EndWeight="5" Weight="1"/>
      <ig:ScaleBreak StartWeight="6" EndWeight="10" Weight="2"/>
   </ig:XamTagCloud.ScaleBreaks>
   …
</ig:XamTagCloud>

In Visual Basic:

Dim scaleBreak1 As New ScaleBreak With {.StartWeight = 1, .EndWeight = 5, .Weight = 1}
tagCloud.ScaleBreaks.Add(scaleBreak1)
Dim scaleBreak2 As New ScaleBreak With {.StartWeight = 6, .EndWeight = 10, .Weight = 2}
tagCloud.ScaleBreaks.Add(scaleBreak2)

In C#:

ScaleBreak scaleBreak1 = new ScaleBreak {StartWeight=1, EndWeight=5, Weight=1};
tagCloud.ScaleBreaks.Add(scaleBreak1);
ScaleBreak scaleBreak2 = new ScaleBreak {StartWeight=6, EndWeight=10, Weight=2};
tagCloud.ScaleBreaks.Add(scaleBreak2);
scale breaks