从perl中给定的excel数据绘制条形图
从perl中给定的excel数据绘制条形图 Excel数据:每周动态变化。我想把它自动化 =============================== 节目如下:从perl中给定的excel数据绘制条形图,perl,excel,charts,Perl,Excel,Charts,从perl中给定的excel数据绘制条形图 Excel数据:每周动态变化。我想把它自动化 =============================== 节目如下: 我在Excel中有样本数据。数据可以是学生在每个科目中获得的姓名和分数 我想为它画excel图表 #!/usr/local/bin/perl print "Content-type: text/html\n\n"; use strict; use Win32::OLE; use Win32::OLE::Cons
- 我在Excel中有样本数据。数据可以是学生在每个科目中获得的姓名和分数
- 我想为它画excel图表
$worksheet2->activate() $chart1->添加_系列( 名称=>'=Sheet1!$B$1', 类别=>“=Sheet1!\$A\$2:\$A:$row\U max”, values=>“=Sheet1!\$B\$2:\$B:$row\U max”, );#!/usr/local/bin/perl print "Content-type: text/html\n\n"; use strict; use Win32::OLE; use Win32::OLE::Const 'Microsoft Excel'; use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::SaveParser; my $parser = new Spreadsheet::ParseExcel::SaveParser; my $workbook = $parser->Parse('Nilu.xls'); my $worksheet1 = $workbook->worksheet('Worksheet1'); $worksheet1->activate(); my ( $row_min, $row_max ) = $worksheet1->row_range(); my ( $col_min, $col_max ) = $worksheet1->col_range(); print "row min:$row_min row_max:$row_max col_max:$col_max\n\n"; my $worksheet2 = my $parser->add_worksheet( 'Worksheet2' ); #$parser->add_worksheet( 'Worksheet2' );
- 样本输入数据
- 样本图表
- “perl Excel数据”到底是什么意思
- 下面是一个Excel与Perl的结合
用Perl更新包含图表的现有文件并不容易(除了在Windows上使用Win32::OLE之外),因此我建议每周生成Excel工作簿。-1:没有问题,没有明显的工作量。请看。我再次用代码更新了信息…善意的建议..jmcnamara…谢谢你的更新。您提供的链接非常有用,但我想知道如何从excel中的动态数据创建图表…因为每周我都会有新的excel表格,其中..最大列范围已知,但最大行范围未知..Fany:我再次用上面的代码更新了我的问题…请建议解决方法。。
# Create a new chart object. In this case an embedded chart.
my $chart1 = $workbook->add_chart( type => 'column', embedded => 1 );
# Configure the first series.
# Set an Excel chart style. Blue colors with white outline and shadow.
$chart1->set_style( 11 );
# Insert the chart into the worksheet (with an offset).
$worksheet2->insert_chart( 'F2', $chart1, 25, 10 );
# Write over the existing file or write a new file.
$parser -> SaveAs('Nilu1.xls');