Back to Devexpress

ASPxCloudControl.Scale Property

aspnet-devexpress-dot-web-dot-aspxcloudcontrol-1523e00b.md

latest4.3 KB
Original Source

ASPxCloudControl.Scale Property

Gets or sets the algorithm that normilizes item weights.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(Scales.Logarithmic)]
public Scales Scale { get; set; }
vb
<DefaultValue(Scales.Logarithmic)>
Public Property Scale As Scales

Property Value

TypeDefaultDescription
ScalesLogarithmic

A Scales enumeration value.

|

Available values:

NameDescription
Linear

The linear scaling is used.

| | Logarithmic |

The logarithmic scaling is used.

|

Remarks

If the linear distribution is used (the Scale property is set to Scales.Linear), the weighted list ranges from 1 to 70 and the ASPxCloudControl.RankCount property is set to 7 , the smallest font size is applied to items whose weight ranges from 1 to 10. The largest font size is applied to items whose weight ranges from 61 to 70, respectively.

To make a cloud more useful, it needs to be divided up into levels with a more equal distribution. To do this, set the Scale property to Scales.Logarithmic.

Example

The following sample code demonstrates how to customize the appearance of the ASPxCloudControl control.

aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, 
PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxCloudControl" tagprefix="dxcc" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DevExpress.Web.ASPxCloudControl;
using System.Linq;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e) {
        ASPxCloudControl1.ShowValues = true;
        ASPxCloudControl1.RankCount = 3;
        ASPxCloudControl1.Scale = Scales.Linear;
        ASPxCloudControl1.Sorted = true;
        ASPxCloudControl1.ForeColor = System.Drawing.Color.AntiqueWhite;
        ASPxCloudControl1.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Justify;

        ASPxCloudControl1.RankProperties[0].ForeColor = System.Drawing.Color.Black;
        ASPxCloudControl1.RankProperties[0].ValueColor = System.Drawing.Color.Gray;

        ASPxCloudControl1.RankProperties[1].ForeColor = System.Drawing.Color.Blue;
        ASPxCloudControl1.RankProperties[1].ValueColor = System.Drawing.Color.LightBlue;

        ASPxCloudControl1.RankProperties[2].ForeColor = System.Drawing.Color.Red;
        ASPxCloudControl1.RankProperties[2].ValueColor = System.Drawing.Color.Pink;

    }
}

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <dxcc:ASPxCloudControl ID="ASPxCloudControl1" runat="server" 
            DataSourceID="XmlDataSource1">     

        </dxcc:ASPxCloudControl>
        <asp:XmlDataSource ID="XmlDataSource1" runat="server" 
            DataFile="~/App_Data/CloudControlWords.xml">
        </asp:XmlDataSource>

    </div>
    </form>
</body>
</html>

See Also

Tag Cloud Control

ASPxCloudControl Class

ASPxCloudControl Members

DevExpress.Web Namespace