Server IP : 103.119.228.120 / Your IP : 18.227.0.255 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/share/man/man3/ |
Upload File : |
.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Spreadsheet::WriteExcel::Chart 3" .TH Spreadsheet::WriteExcel::Chart 3 "2013-11-07" "perl v5.16.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Chart \- A writer class for Excel Charts. .SH "SYNOPSIS" .IX Header "SYNOPSIS" To create a simple Excel file with a chart using Spreadsheet::WriteExcel: .PP .Vb 1 \& #!/usr/bin/perl \-w \& \& use strict; \& use Spreadsheet::WriteExcel; \& \& my $workbook = Spreadsheet::WriteExcel\->new( \*(Aqchart.xls\*(Aq ); \& my $worksheet = $workbook\->add_worksheet(); \& \& my $chart = $workbook\->add_chart( type => \*(Aqcolumn\*(Aq ); \& \& # Configure the chart. \& $chart\->add_series( \& categories => \*(Aq=Sheet1!$A$2:$A$7\*(Aq, \& values => \*(Aq=Sheet1!$B$2:$B$7\*(Aq, \& ); \& \& # Add the worksheet data the chart refers to. \& my $data = [ \& [ \*(AqCategory\*(Aq, 2, 3, 4, 5, 6, 7 ], \& [ \*(AqValue\*(Aq, 1, 4, 5, 2, 1, 5 ], \& ]; \& \& $worksheet\->write( \*(AqA1\*(Aq, $data ); \& \& _\|_END_\|_ .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \f(CW\*(C`Chart\*(C'\fR module is an abstract base class for modules that implement charts in Spreadsheet::WriteExcel. The information below is applicable to all of the available subclasses. .PP The \f(CW\*(C`Chart\*(C'\fR module isn't used directly, a chart object is created via the Workbook \f(CW\*(C`add_chart()\*(C'\fR method where the chart type is specified: .PP .Vb 1 \& my $chart = $workbook\->add_chart( type => \*(Aqcolumn\*(Aq ); .Ve .PP Currently the supported chart types are: .IP "\(bu" 4 \&\f(CW\*(C`area\*(C'\fR: Creates an Area (filled line) style chart. See Spreadsheet::WriteExcel::Chart::Area. .IP "\(bu" 4 \&\f(CW\*(C`bar\*(C'\fR: Creates a Bar style (transposed histogram) chart. See Spreadsheet::WriteExcel::Chart::Bar. .IP "\(bu" 4 \&\f(CW\*(C`column\*(C'\fR: Creates a column style (histogram) chart. See Spreadsheet::WriteExcel::Chart::Column. .IP "\(bu" 4 \&\f(CW\*(C`line\*(C'\fR: Creates a Line style chart. See Spreadsheet::WriteExcel::Chart::Line. .IP "\(bu" 4 \&\f(CW\*(C`pie\*(C'\fR: Creates an Pie style chart. See Spreadsheet::WriteExcel::Chart::Pie. .IP "\(bu" 4 \&\f(CW\*(C`scatter\*(C'\fR: Creates an Scatter style chart. See Spreadsheet::WriteExcel::Chart::Scatter. .IP "\(bu" 4 \&\f(CW\*(C`stock\*(C'\fR: Creates an Stock style chart. See Spreadsheet::WriteExcel::Chart::Stock. .PP More charts and sub-types will be supported in time. See the \*(L"\s-1TODO\*(R"\s0 section. .PP Methods that are common to all chart types are documented below. .SH "CHART METHODS" .IX Header "CHART METHODS" .SS "\fIadd_series()\fP" .IX Subsection "add_series()" In an Excel chart a \*(L"series\*(R" is a collection of information such as values, x\-axis labels and the name that define which data is plotted. These settings are displayed when you select the \f(CW\*(C`Chart \-> Source Data...\*(C'\fR menu option. .PP With a Spreadsheet::WriteExcel chart object the \f(CW\*(C`add_series()\*(C'\fR method is used to set the properties for a series: .PP .Vb 6 \& $chart\->add_series( \& categories => \*(Aq=Sheet1!$A$2:$A$10\*(Aq, \& values => \*(Aq=Sheet1!$B$2:$B$10\*(Aq, \& name => \*(AqSeries name\*(Aq, \& name_formula => \*(Aq=Sheet1!$B$1\*(Aq, \& ); .Ve .PP The properties that can be set are: .IP "\(bu" 4 \&\f(CW\*(C`values\*(C'\fR .Sp This is the most important property of a series and must be set for every chart object. It links the chart with the worksheet data that it displays. Note the format that should be used for the formula. See \*(L"Working with Cell Ranges\*(R". .IP "\(bu" 4 \&\f(CW\*(C`categories\*(C'\fR .Sp This sets the chart category labels. The category is more or less the same as the X\-axis. In most chart types the \f(CW\*(C`categories\*(C'\fR property is optional and the chart will just assume a sequential series from \f(CW\*(C`1 .. n\*(C'\fR. .IP "\(bu" 4 \&\f(CW\*(C`name\*(C'\fR .Sp Set the name for the series. The name is displayed in the chart legend and in the formula bar. The name property is optional and if it isn't supplied will default to \f(CW\*(C`Series 1 .. n\*(C'\fR. .IP "\(bu" 4 \&\f(CW\*(C`name_formula\*(C'\fR .Sp Optional, can be used to link the name to a worksheet cell. See \*(L"Chart names and links\*(R". .PP You can add more than one series to a chart, in fact some chart types such as \f(CW\*(C`stock\*(C'\fR require it. The series numbering and order in the final chart is the same as the order in which that are added. .PP .Vb 6 \& # Add the first series. \& $chart\->add_series( \& categories => \*(Aq=Sheet1!$A$2:$A$7\*(Aq, \& values => \*(Aq=Sheet1!$B$2:$B$7\*(Aq, \& name => \*(AqTest data series 1\*(Aq, \& ); \& \& # Add another series. Category is the same but values are different. \& $chart\->add_series( \& categories => \*(Aq=Sheet1!$A$2:$A$7\*(Aq, \& values => \*(Aq=Sheet1!$C$2:$C$7\*(Aq, \& name => \*(AqTest data series 2\*(Aq, \& ); .Ve .SS "\fIset_x_axis()\fP" .IX Subsection "set_x_axis()" The \f(CW\*(C`set_x_axis()\*(C'\fR method is used to set properties of the X axis. .PP .Vb 1 \& $chart\->set_x_axis( name => \*(AqSample length (m)\*(Aq ); .Ve .PP The properties that can be set are: .IP "\(bu" 4 \&\f(CW\*(C`name\*(C'\fR .Sp Set the name (title or caption) for the axis. The name is displayed below the X axis. This property is optional. The default is to have no axis name. .IP "\(bu" 4 \&\f(CW\*(C`name_formula\*(C'\fR .Sp Optional, can be used to link the name to a worksheet cell. See \*(L"Chart names and links\*(R". .PP Additional axis properties such as range, divisions and ticks will be made available in later releases. See the \*(L"\s-1TODO\*(R"\s0 section. .SS "\fIset_y_axis()\fP" .IX Subsection "set_y_axis()" The \f(CW\*(C`set_y_axis()\*(C'\fR method is used to set properties of the Y axis. .PP .Vb 1 \& $chart\->set_y_axis( name => \*(AqSample weight (kg)\*(Aq ); .Ve .PP The properties that can be set are: .IP "\(bu" 4 \&\f(CW\*(C`name\*(C'\fR .Sp Set the name (title or caption) for the axis. The name is displayed to the left of the Y axis. This property is optional. The default is to have no axis name. .IP "\(bu" 4 \&\f(CW\*(C`name_formula\*(C'\fR .Sp Optional, can be used to link the name to a worksheet cell. See \*(L"Chart names and links\*(R". .PP Additional axis properties such as range, divisions and ticks will be made available in later releases. See the \*(L"\s-1TODO\*(R"\s0 section. .SS "\fIset_title()\fP" .IX Subsection "set_title()" The \f(CW\*(C`set_title()\*(C'\fR method is used to set properties of the chart title. .PP .Vb 1 \& $chart\->set_title( name => \*(AqYear End Results\*(Aq ); .Ve .PP The properties that can be set are: .IP "\(bu" 4 \&\f(CW\*(C`name\*(C'\fR .Sp Set the name (title) for the chart. The name is displayed above the chart. This property is optional. The default is to have no chart title. .IP "\(bu" 4 \&\f(CW\*(C`name_formula\*(C'\fR .Sp Optional, can be used to link the name to a worksheet cell. See \*(L"Chart names and links\*(R". .SS "\fIset_legend()\fP" .IX Subsection "set_legend()" The \f(CW\*(C`set_legend()\*(C'\fR method is used to set properties of the chart legend. .PP .Vb 1 \& $chart\->set_legend( position => \*(Aqnone\*(Aq ); .Ve .PP The properties that can be set are: .IP "\(bu" 4 \&\f(CW\*(C`position\*(C'\fR .Sp Set the position of the chart legend. .Sp .Vb 1 \& $chart\->set_legend( position => \*(Aqnone\*(Aq ); .Ve .Sp The default legend position is \f(CW\*(C`bottom\*(C'\fR. The currently supported chart positions are: .Sp .Vb 2 \& none \& bottom .Ve .Sp The other legend positions will be added soon. .SS "\fIset_chartarea()\fP" .IX Subsection "set_chartarea()" The \f(CW\*(C`set_chartarea()\*(C'\fR method is used to set the properties of the chart area. In Excel the chart area is the background area behind the chart. .PP The properties that can be set are: .IP "\(bu" 4 \&\f(CW\*(C`color\*(C'\fR .Sp Set the colour of the chart area. The Excel default chart area color is 'white', index 9. See \*(L"Chart object colours\*(R". .IP "\(bu" 4 \&\f(CW\*(C`line_color\*(C'\fR .Sp Set the colour of the chart area border line. The Excel default border line colour is 'black', index 9. See \*(L"Chart object colours\*(R". .IP "\(bu" 4 \&\f(CW\*(C`line_pattern\*(C'\fR .Sp Set the pattern of the of the chart area border line. The Excel default pattern is 'none', index 0 for a chart sheet and 'solid', index 1, for an embedded chart. See \*(L"Chart line patterns\*(R". .IP "\(bu" 4 \&\f(CW\*(C`line_weight\*(C'\fR .Sp Set the weight of the of the chart area border line. The Excel default weight is 'narrow', index 2. See \*(L"Chart line weights\*(R". .PP Here is an example of setting several properties: .PP .Vb 6 \& $chart\->set_chartarea( \& color => \*(Aqred\*(Aq, \& line_color => \*(Aqblack\*(Aq, \& line_pattern => 2, \& line_weight => 3, \& ); .Ve .PP Note, for chart sheets the chart area border is off by default. For embedded charts this is on by default. .SS "\fIset_plotarea()\fP" .IX Subsection "set_plotarea()" The \f(CW\*(C`set_plotarea()\*(C'\fR method is used to set properties of the plot area of a chart. In Excel the plot area is the area between the axes on which the chart series are plotted. .PP The properties that can be set are: .IP "\(bu" 4 \&\f(CW\*(C`visible\*(C'\fR .Sp Set the visibility of the plot area. The default is 1 for visible. Set to 0 to hide the plot area and have the same colour as the background chart area. .IP "\(bu" 4 \&\f(CW\*(C`color\*(C'\fR .Sp Set the colour of the plot area. The Excel default plot area color is 'silver', index 23. See \*(L"Chart object colours\*(R". .IP "\(bu" 4 \&\f(CW\*(C`line_color\*(C'\fR .Sp Set the colour of the plot area border line. The Excel default border line colour is 'gray', index 22. See \*(L"Chart object colours\*(R". .IP "\(bu" 4 \&\f(CW\*(C`line_pattern\*(C'\fR .Sp Set the pattern of the of the plot area border line. The Excel default pattern is 'solid', index 1. See \*(L"Chart line patterns\*(R". .IP "\(bu" 4 \&\f(CW\*(C`line_weight\*(C'\fR .Sp Set the weight of the of the plot area border line. The Excel default weight is 'narrow', index 2. See \*(L"Chart line weights\*(R". .PP Here is an example of setting several properties: .PP .Vb 6 \& $chart\->set_plotarea( \& color => \*(Aqred\*(Aq, \& line_color => \*(Aqblack\*(Aq, \& line_pattern => 2, \& line_weight => 3, \& ); .Ve .SH "WORKSHEET METHODS" .IX Header "WORKSHEET METHODS" In Excel a chart sheet (i.e, a chart that isn't embedded) shares properties with data worksheets such as tab selection, headers, footers, margins and print properties. .PP In Spreadsheet::WriteExcel you can set chart sheet properties using the same methods that are used for Worksheet objects. .PP The following Worksheet methods are also available through a non-embedded Chart object: .PP .Vb 8 \& get_name() \& activate() \& select() \& hide() \& set_first_sheet() \& protect() \& set_zoom() \& set_tab_color() \& \& set_landscape() \& set_portrait() \& set_paper() \& set_margins() \& set_header() \& set_footer() .Ve .PP See Spreadsheet::WriteExcel for a detailed explanation of these methods. .SH "EXAMPLE" .IX Header "EXAMPLE" Here is a complete example that demonstrates some of the available features when creating a chart. .PP .Vb 1 \& #!/usr/bin/perl \-w \& \& use strict; \& use Spreadsheet::WriteExcel; \& \& my $workbook = Spreadsheet::WriteExcel\->new( \*(Aqchart_area.xls\*(Aq ); \& my $worksheet = $workbook\->add_worksheet(); \& my $bold = $workbook\->add_format( bold => 1 ); \& \& # Add the worksheet data that the charts will refer to. \& my $headings = [ \*(AqNumber\*(Aq, \*(AqSample 1\*(Aq, \*(AqSample 2\*(Aq ]; \& my $data = [ \& [ 2, 3, 4, 5, 6, 7 ], \& [ 1, 4, 5, 2, 1, 5 ], \& [ 3, 6, 7, 5, 4, 3 ], \& ]; \& \& $worksheet\->write( \*(AqA1\*(Aq, $headings, $bold ); \& $worksheet\->write( \*(AqA2\*(Aq, $data ); \& \& # Create a new chart object. In this case an embedded chart. \& my $chart = $workbook\->add_chart( type => \*(Aqarea\*(Aq, embedded => 1 ); \& \& # Configure the first series. (Sample 1) \& $chart\->add_series( \& name => \*(AqSample 1\*(Aq, \& categories => \*(Aq=Sheet1!$A$2:$A$7\*(Aq, \& values => \*(Aq=Sheet1!$B$2:$B$7\*(Aq, \& ); \& \& # Configure the second series. (Sample 2) \& $chart\->add_series( \& name => \*(AqSample 2\*(Aq, \& categories => \*(Aq=Sheet1!$A$2:$A$7\*(Aq, \& values => \*(Aq=Sheet1!$C$2:$C$7\*(Aq, \& ); \& \& # Add a chart title and some axis labels. \& $chart\->set_title ( name => \*(AqResults of sample analysis\*(Aq ); \& $chart\->set_x_axis( name => \*(AqTest number\*(Aq ); \& $chart\->set_y_axis( name => \*(AqSample length (cm)\*(Aq ); \& \& # Insert the chart into the worksheet (with an offset). \& $worksheet\->insert_chart( \*(AqD2\*(Aq, $chart, 25, 10 ); \& \& _\|_END_\|_ .Ve .SH "Chart object colours" .IX Header "Chart object colours" Many of the chart objects supported by Spreadsheet::WriteExcl allow the default colours to be changed. Excel provides a palette of 56 colours and in Spreadsheet::WriteExcel these colours are accessed via their palette index in the range 8..63. .PP The most commonly used colours can be accessed by name or index. .PP .Vb 6 \& black => 8, green => 17, navy => 18, \& white => 9, orange => 53, pink => 33, \& red => 10, gray => 23, purple => 20, \& blue => 12, lime => 11, silver => 22, \& yellow => 13, cyan => 15, \& brown => 16, magenta => 14, .Ve .PP For example the following are equivalent. .PP .Vb 2 \& $chart\->set_plotarea( color => 10 ); \& $chart\->set_plotarea( color => \*(Aqred\*(Aq ); .Ve .PP The colour palette is shown in \f(CW\*(C`palette.html\*(C'\fR in the \f(CW\*(C`docs\*(C'\fR directory of the distro. An Excel version of the palette can be generated using \f(CW\*(C`colors.pl\*(C'\fR in the \f(CW\*(C`examples\*(C'\fR directory. .PP User defined colours can be set using the \f(CW\*(C`set_custom_color()\*(C'\fR workbook method. This and other aspects of using colours are discussed in the \*(L"Colours in Excel\*(R" section of the main Spreadsheet::WriteExcel documentation: <http://search.cpan.org/dist/Spreadsheet\-WriteExcel/lib/Spreadsheet/WriteExcel.pm#COLOURS_IN_EXCEL>. .SH "Chart line patterns" .IX Header "Chart line patterns" Chart lines patterns can be set using either an index or a name: .PP .Vb 2 \& $chart\->set_plotarea( weight => 2 ); \& $chart\->set_plotarea( weight => \*(Aqdash\*(Aq ); .Ve .PP Chart lines have 9 possible patterns are follows: .PP .Vb 9 \& \*(Aqnone\*(Aq => 0, \& \*(Aqsolid\*(Aq => 1, \& \*(Aqdash\*(Aq => 2, \& \*(Aqdot\*(Aq => 3, \& \*(Aqdash\-dot\*(Aq => 4, \& \*(Aqdash\-dot\-dot\*(Aq => 5, \& \*(Aqmedium\-gray\*(Aq => 6, \& \*(Aqdark\-gray\*(Aq => 7, \& \*(Aqlight\-gray\*(Aq => 8, .Ve .PP The patterns 1\-8 are shown in order in the drop down dialog boxes in Excel. The default pattern is 'solid', index 1. .SH "Chart line weights" .IX Header "Chart line weights" Chart lines weights can be set using either an index or a name: .PP .Vb 2 \& $chart\->set_plotarea( weight => 1 ); \& $chart\->set_plotarea( weight => \*(Aqhairline\*(Aq ); .Ve .PP Chart lines have 4 possible weights are follows: .PP .Vb 4 \& \*(Aqhairline\*(Aq => 1, \& \*(Aqnarrow\*(Aq => 2, \& \*(Aqmedium\*(Aq => 3, \& \*(Aqwide\*(Aq => 4, .Ve .PP The weights 1\-4 are shown in order in the drop down dialog boxes in Excel. The default weight is 'narrow', index 2. .SH "Chart names and links" .IX Header "Chart names and links" The \f(CWadd_series())\fR, \f(CW\*(C`set_x_axis()\*(C'\fR, \f(CW\*(C`set_y_axis()\*(C'\fR and \f(CW\*(C`set_title()\*(C'\fR methods all support a \f(CW\*(C`name\*(C'\fR property. In general these names can be either a static string or a link to a worksheet cell. If you choose to use the \f(CW\*(C`name_formula\*(C'\fR property to specify a link then you should also the \f(CW\*(C`name\*(C'\fR property. This isn't strictly required by Excel but some third party applications expect it to be present. .PP .Vb 4 \& $chart\->set_title( \& name => \*(AqYear End Results\*(Aq, \& name_formula => \*(Aq=Sheet1!$C$1\*(Aq, \& ); .Ve .PP These links should be used sparingly since they aren't commonly used in Excel charts. .SH "Chart names and Unicode" .IX Header "Chart names and Unicode" The \f(CWadd_series())\fR, \f(CW\*(C`set_x_axis()\*(C'\fR, \f(CW\*(C`set_y_axis()\*(C'\fR and \f(CW\*(C`set_title()\*(C'\fR methods all support a \f(CW\*(C`name\*(C'\fR property. These names can be \s-1UTF8\s0 strings if you are using perl 5.8+. .PP .Vb 2 \& # perl 5.8+ example: \& my $smiley = "\ex{263A}"; \& \& $chart\->set_title( name => "Best. Results. Ever! $smiley" ); .Ve .PP For older perls you write Unicode strings as \s-1UTF\-16BE\s0 by adding a \f(CW\*(C`name_encoding\*(C'\fR property: .PP .Vb 2 \& # perl 5.005 example: \& my $utf16be_name = pack \*(Aqn\*(Aq, 0x263A; \& \& $chart\->set_title( \& name => $utf16be_name, \& name_encoding => 1, \& ); .Ve .PP This methodology is explained in the \*(L"\s-1UNICODE IN EXCEL\*(R"\s0 section of Spreadsheet::WriteExcel but is semi-deprecated. If you are using Unicode the easiest option is to just use \s-1UTF8\s0 in perl 5.8+. .SH "Working with Cell Ranges" .IX Header "Working with Cell Ranges" In the section on \f(CW\*(C`add_series()\*(C'\fR it was noted that the series must be defined using a range formula: .PP .Vb 1 \& $chart\->add_series( values => \*(Aq=Sheet1!$B$2:$B$10\*(Aq ); .Ve .PP The worksheet name must be specified (even for embedded charts) and the cell references must be \*(L"absolute\*(R" references, i.e., they must contain \f(CW\*(C`$\*(C'\fR signs. This is the format that is required by Excel for chart references. .PP Since it isn't very convenient to work with this type of string programmatically the Spreadsheet::WriteExcel::Utility module, which is included with Spreadsheet::WriteExcel, provides a function called \f(CW\*(C`xl_range_formula()\*(C'\fR to convert from zero based row and column cell references to an A1 style formula string. .PP The syntax is: .PP .Vb 1 \& xl_range_formula($sheetname, $row_1, $row_2, $col_1, $col_2) .Ve .PP If you include it in your program, using the standard import syntax, you can use the function as follows: .PP .Vb 3 \& # Include the Utility module or just the function you need. \& use Spreadsheet::WriteExcel::Utility qw( xl_range_formula ); \& ... \& \& # Then use it as required. \& $chart\->add_series( \& categories => xl_range_formula( \*(AqSheet1\*(Aq, 1, 9, 0, 0 ), \& values => xl_range_formula( \*(AqSheet1\*(Aq, 1, 9, 1, 1 ), \& ); \& \& # Which is the same as: \& $chart\->add_series( \& categories => \*(Aq=Sheet1!$A$2:$A$10\*(Aq, \& values => \*(Aq=Sheet1!$B$2:$B$10\*(Aq, \& ); .Ve .PP See Spreadsheet::WriteExcel::Utility for more details. .SH "TODO" .IX Header "TODO" Charts in Spreadsheet::WriteExcel are a work in progress. More chart types and features will be added in time. Please be patient. Even a small feature can take a week or more to implement, test and document. .PP Features that are on the \s-1TODO\s0 list and will be added are: .IP "\(bu" 4 Chart sub-types. .IP "\(bu" 4 Colours and formatting options. For now you will have to make do with the default Excel colours and formats. .IP "\(bu" 4 Axis controls, gridlines. .IP "\(bu" 4 3D charts. .IP "\(bu" 4 Embedded data in charts for third party application support. See Known Issues. .IP "\(bu" 4 Additional chart types such as Bubble and Radar. Send an email if you are interested in other types and they will be added to the queue. .PP If you are interested in sponsoring a feature let me know. .SH "KNOWN ISSUES" .IX Header "KNOWN ISSUES" .IP "\(bu" 4 Currently charts don't contain embedded data from which the charts can be rendered. Excel and most other third party applications ignore this and read the data via the links that have been specified. However, some applications may complain or not render charts correctly. The preview option in Mac \s-1OS X\s0 is an known example. This will be fixed in a later release. .IP "\(bu" 4 When there are several charts with titles set in a workbook some of the titles may display at a font size of 10 instead of the default 12 until another chart with the title set is viewed. .IP "\(bu" 4 Stock (and other) charts should have the X\-axis dates aligned at an angle for clarity. This will be fixed at a later stage. .SH "AUTHOR" .IX Header "AUTHOR" John McNamara jmcnamara@cpan.org .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright MM-MMX, John McNamara. .PP All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.