<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl

#######################################################################
#
# A simple example of how to use the Excel::Writer::XLSX module to
# add shapes and one-to-many connectors to an Excel xlsx file.
#
# Copyright 2000-2020, John McNamara, jmcnamara@cpan.org
#

use strict;
use warnings;
use Excel::Writer::XLSX;

my $workbook  = Excel::Writer::XLSX-&gt;new( 'shape8.xlsx' );
my $worksheet = $workbook-&gt;add_worksheet();

# Add a circle, with centered text. c is for circle, not center.
my $cw = 60;
my $ch = 60;
my $cx = 210;
my $cy = 190;

my $ellipse = $workbook-&gt;add_shape(
    type   =&gt; 'ellipse',
    id     =&gt; 2,
    text   =&gt; "Hello\nWorld",
    width  =&gt; $cw,
    height =&gt; $ch
);
$worksheet-&gt;insert_shape( 'A1', $ellipse, $cx, $cy );

# Add a plus sign at 4 different positions around the circle.
my $pw = 20;
my $ph = 20;
my $px = 120;
my $py = 250;
my $plus =
  $workbook-&gt;add_shape( type =&gt; 'plus', id =&gt; 3, width =&gt; $pw, height =&gt; $ph );
my $p1 = $worksheet-&gt;insert_shape( 'A1', $plus, 350, 150 );    #  2:00
my $p2 = $worksheet-&gt;insert_shape( 'A1', $plus, 350, 350 );    #  4:00
my $p3 = $worksheet-&gt;insert_shape( 'A1', $plus, 150, 350 );    #  8:00
my $p4 = $worksheet-&gt;insert_shape( 'A1', $plus, 150, 150 );    # 10:00

my $cxn_shape = $workbook-&gt;add_shape( type =&gt; 'bentConnector3', fill =&gt; 0 );

$cxn_shape-&gt;set_start( $ellipse-&gt;get_id() );
$cxn_shape-&gt;set_start_index( 2 );    # 2nd connection pt, clockwise from top(0).
$cxn_shape-&gt;set_start_side( 'r' );   # r)ight or b)ottom.

$cxn_shape-&gt;set_end( $p1-&gt;get_id() );
$cxn_shape-&gt;set_end_index( 3 );      # 3rd connection point on plus, right side
$cxn_shape-&gt;set_end_side( 'l' );
$worksheet-&gt;insert_shape( 'A1', $cxn_shape, 0, 0 );

$cxn_shape-&gt;set_end( $p2-&gt;get_id() );
$worksheet-&gt;insert_shape( 'A1', $cxn_shape, 0, 0 );

$cxn_shape-&gt;set_end( $p3-&gt;get_id() );
$worksheet-&gt;insert_shape( 'A1', $cxn_shape, 0, 0 );

$cxn_shape-&gt;set_end( $p4-&gt;get_id() );
$cxn_shape-&gt;set_adjustments( -50, 45, 120 );
$worksheet-&gt;insert_shape( 'A1', $cxn_shape, 0, 0 );

$workbook-&gt;close();

__END__

</pre></body></html>