How to make a line callout


Summary
This article shows how to make a line callout; however, it does not show how to apply the callout to a feature dataset.

Making a line callout

Line callouts provide a background for text that can be linked by a line to an anchor point. The symbols used for the leader line, accent bar, and border can be changed to suit the specific needs of the application for the callout. The following code example shows the basic steps for creating the callout:
[Java]
static void lineCallout()throws Exception{
    // Create the background fill symbol
    IRgbColor backgroundRgbColorCls = new RgbColor();
    backgroundRgbColorCls.setRed(255);
    ISimpleFillSymbol simpleFillSymbolCls = new SimpleFillSymbol();
    simpleFillSymbolCls.setColor(backgroundRgbColorCls);
    simpleFillSymbolCls.setStyle(esriSimpleFillStyle.esriSFSSolid);

    // Create the line symbol used as the LeaderLine
    IRgbColor leaderlineRgbColorCls = new RgbColor();
    leaderlineRgbColorCls.setBlue(255);
    ISimpleLineSymbol leaderlineSimpleLineSymbolCls = new SimpleLineSymbol();
    leaderlineSimpleLineSymbolCls.setColor(leaderlineRgbColorCls);
    leaderlineSimpleLineSymbolCls.setWidth(2);

    // Create the line symbol used as the AccentBar
    IRgbColor accentbarRgbColorCls = new RgbColor();
    accentbarRgbColorCls.setGreen(255);
    ISimpleLineSymbol accentbarSimpleLineSymbolCls = new SimpleLineSymbol();
    accentbarSimpleLineSymbolCls.setColor(accentbarRgbColorCls);

    // Create the Callout
    ILineCallout lineCalloutCls = new LineCallout();
    lineCalloutCls.setStyle(esriLineCalloutStyle.esriLCSFourPoint);
    lineCalloutCls.setBorderByRef(simpleFillSymbolCls);
    lineCalloutCls.setAccentBarByRef(accentbarSimpleLineSymbolCls);
    lineCalloutCls.setLeaderLineByRef(leaderlineSimpleLineSymbolCls);
}


See Also:

How to make a cartographic line symbol
How to make a character marker symbol
How to make a gradient fill symbol
How to make a line fill symbol
How to make a picture marker symbol
How to make different types of colors




Development licensingDeployment licensing
ArcGIS for Desktop BasicArcGIS for Desktop Basic
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced
Engine Developer KitEngine