Subscribe to RSS Feed

Categories

Archives

Unnamed Chart Package 0.0.1

↓ skip to article

I’ve been hacking away on a charting package the last week or two and despite the fact that I’m not very happy with it I’m going to let it loose.

chart-0.0.1.tar.bz2

I spent a lot of time with Chart packages a few years back when at the last $job. None of them left me feeling satisfied and I guess I’m just hubristic enough to think I can do better. Regardless it’s a nice hobby.

my $chart = new Chart(500, 300);

my $series = new Chart::Data::Series(); my @keys = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); my @vals = (42, 25, 86, 23, 2, 19, 103, 12, 54, 9); $series->keys(\@keys); $series->values(\@vals);

my $dataset = new Chart::Data::DataSet(); $dataset->series([ $series ]); $chart->plot->datasets([ $dataset ]); $chart->draw(); my $img = $chart->image(); # GD image to do with as you please

That’s the nickel tour. At the moment it supports a handful of chart types, multiple domain and range axes, and is quite speedy. My goal is to create a fast, extensible OO charting module that creates pretty charts. I’ve also been very strict with tests and it has paid off many times. Each time I’ve made some huge change under the hood I’ve been able to work out the kinks faster due to my extensive test suite.

My next goal is to get Markers working so I can draw the background grid on the Plot and pave the way for temporal axes and more fun things. I just needed to get something out there.

I’ll also ask anyone who has good name for a charting package to leave a comment. Unfortunately ‘Chart’ is already taken and GD::Chart seems too important for my purposes. I have a mind to perhaps port the thing to Ruby when I get to a stopping point in Perl. Ruby needs a good charting package.

Comments (No comments)

There are no comments for this post so far.

Post a comment