ComponentOne TreeMap for ASP.NET WebForms
Features / Tooltips
In This Topic
    Tooltips
    In This Topic

    You can display a region's Label and Value on hovering the mouse over a region by simply setting the ShowTooltip property to true. This topic uses the sample created in

    This topic uses the sample created in the Quick Start topic and displays the area covered by each country (in square miles) when you hover the mouse over a country.

    In the Designer

    1. Right click the TreeMap control and select Properties to open the Properties Window.
    2. Set the ShowTooltip property to true. The property is set to False by default.
    3. Set the text that you want to display when you hover the mouse over the titles in the control, in the Tooltip property.
    4. Press F5 to run the project.

    In Source View

    Set the ShowTooltip property to true and set the the tooltip text inside the <c1:C1TreeMap> tag, to display tooltips:

    Source View
    Copy Code
    <c1:c1treemap id="C1TreeMap1" runat="server" height="300px" width="500px" showbackbutton="True" viewstatemode="Enabled" ShowTooltip="True" ToolTip="Area covered (in square miles)">           
    

    In Code

    Add the following code to the Page_Load event, to set the ShowTooltip property to true and to set the the tooltip text.

    C#
    Copy Code
    C1TreeMap1.ShowTooltip = true;
    C1TreeMap1.ToolTip = "Area covered(in square miles)";
    
    VB
    Copy Code
    C1TreeMap1.ShowTooltip = True
    C1TreeMap1.ToolTip = "Area covered (in square miles)"
    

    What You've Accomplished

    When you run the project, hover the mouse over a region, notice that the Label and Value of the region are displayed in the tooltip, as shown below:

    Hover the mouse over the titles, notice that the tooltip text that you entered is displayed in the tooltip, as shown below: