Code Monkey home page Code Monkey logo

problem-excel-writer-xlsx-'s People

Contributors

alexandredagnelies avatar

problem-excel-writer-xlsx-'s Issues

link problem between the shapes when using the insert_image () method

There is a problem when iinserting several shapes linked together and an image.
When the connectors are inserted in the same worksheet that an image, they are no longer connected to their respective shapes.

To link the shapes, I used the example of documentation shape5.pl.
http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.84/examples/shape5.pl

To insert the image, I simply use the insert_image () method.

I use the version of perl 5.20.2 and 0.84 version of module Excel::Writer::XLSX.
Here is a simple example program that demonstrates this problem.

 #!/usr/bin/perl 
use strict; 
use warnings;
use Excel::Writer::XLSX;

my $workbook  = Excel::Writer::XLSX->new( 'example.xlsx' );
my $worksheet = $workbook->add_worksheet();

my $s1 = $workbook->add_shape( );
$worksheet->insert_shape( 'A1', $s1, 0, 50);
my $s2 = $workbook->add_shape();
$worksheet->insert_shape( 'A1', $s2, 0 ,150);

#Create a connector to link the two shapes.
my $cxn_shape = $workbook->add_shape( type => 'straightConnector1' );

#Link the start of the connector
$cxn_shape->set_start( $s1->get_id() );
$cxn_shape->set_start_index( 2 );   
$cxn_shape->set_start_side( 'b' );   

#Link the end of the connector
$cxn_shape->set_end( $s2->get_id() );
$cxn_shape->set_end_index( 0 );      
$cxn_shape->set_end_side( 't' );    

$worksheet->insert_shape( 'A1', $cxn_shape, 0, 0 );

#image
$worksheet->insert_image('A1', 'image.png');

__END__

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.