What do I use to display CSV data as a chart?
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 bi开发者_如何学Ct 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.
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.
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.
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.
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.
Chart::Clicker is good. Its output is less pixelated than that of GD::Graph, and it supports transparent overlapping parts.
精彩评论