Configuring Interactions
Send Feedback

Glossary Item Box

Topic Overview

Purpose

This topic provides an introductory overview of interacting with the IGTreemapView™ control.

In this topic


Introduction

Interactions summary

The IGTreemapView provides support for the 3 most common gestures; pinch, tap and long press.

  • The pinch gesture is for zooming out of a viewed child node and is handled by default within the IGTreemapView
  • Tapping a node automatically makes it a root node and puts it on top of the IGTreemapView, additionally, if handled the IGTreemapView will call the IGTreemapViewDelegate method treemapView:tapWithNode:atPoint:
  • The long press gesture is used to call the IGTreemapViewDelegate method treemapView:viewForTooltipWithNode: to return and render a UIView tooltip

Displaying a Tooltip – Code Example

Description

The following code implements the IGTreemapViewDelegate’s treemapView:viewForTooltipWithNode: method to display a tooltip containing the node’s label string.

Prerequisites

This code example requires the inclusion of the Chart framework, detail about how to add this framework can be found in the Adding the Chart Framework File topic.

Code

In Objective-C:

-(UIView *)treemapView:(IGTreemapView *)treemapView viewForTooltipWithNode:(IGTreemapNode *)node
{
    UILabel *label = [[UILabel alloc]init];
    label.text = node.label;
    [label setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
    [label sizeToFit];
    return label;
}

In C#:

public class TreemapDelegate : IGTreemapViewDelegate
{
      public override UIView ResolveNodeTooltipView (IGTreemapView treemapView, IGTreemapNode node)
      {
            UILabel label = new UILabel();
            label.Text = node.Label;
            label.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
            label.SizeToFit ();
            return label;
      }
}

Related Content

Topics

The following topic provides additional information related to this topic.

Topic

Purpose

The topics in this group cover enabling, configuring, and using the IGTreemapView control’s supported features.