views:

91

answers:

5

I have a set of data stored in text files, which I have now via Perl put into a CSV file. The data in question now needs to be displayed in a chart.

What suggestions do you have for doing this? XML was suggested, but XML can't put the data into a chart itself.

Ideally what would happen is: the data would be decoded from the text file, put into an Excel spreadsheet and displayed as a chart, all with one bit of code, as there are many of these text files with data in them.

Perl, XML, C, C++, C# and VB are all available to use.

+1  A: 

With Perl, you can use the Win32::OLE module to automate placing the data in an Excel spreadsheet and displaying it in a chart.

You will need to be familiar with the OLE library though in order to understand what methods/properties to call and set.

Zaid
I don't suppose you know what the {ChartType} is for a scatter chart?
Andy
Wait, found it; xlXYScatter.
Andy
@Andy : The OLE library is documented in the Object Browser. Go into VBA mode (within Excel) and hit `F2`.
Zaid
+6  A: 

Spreadsheet::WriteExcel is an excellent CPAN module for creating Excel files in Perl.

In particular take a look at Spreadsheet::WriteExcel::Chart which allows you to create charts within the excel file.

/I3az/

draegtun
+1  A: 

For my use, I have found GD::Graph to be a decent option for generating charts in PNG format. You can also use Chart::Gnuplot.

I also have an example of creating a chart in an Excel document using Win32::OLE.

Sinan Ünür
+2  A: 

How about Gnuplot? You can send the data and commands to it through STDIN, which works in Perl very well or there are some libraries.

eumiro
A: 

Chart::Clicker is good. Its output is less pixelated than that of GD::Graph, and it supports transparent overlapping parts.

Thomas Kappler