The Charting Project

I did a bit of a re-think on the charting project, based on the similarities and differences of the pie and bar charts. I’ve scrapped the original repository, and set up a new one at http://lucernesys.com/hzcharts. It’s read-only, like the old one. HZCharts is a better description of the project, and I’ve re-factored the code to eliminate some duplication, but more work is probably needed.

For a quick hit download the source, compile and run the program. Drag the mouse around in the pie chart window to move the chart around. Then hold down ‘ctrl’ and drag to explode the pie. Now, go to the ‘View’ menu and select bar chart. You can move that chart with the mouse, too.

Any suggestions, criticisms, and especially code improvements are welcome. Leave a comment or email me.

1.27, 1.28, and More Charts

I have a bad habit of neglecting to announce new releases in this blog. Horizon 1.2.7 came out last week, with customizable holidays, CSV export, and enhanced cell editing. (Also added, a small window to enter your name and license code. The esellerate engine should do this automatically, but it was failing for some people. Now, there’s a manual option.)

That was quickly followed by 1.2.8 yesterday. 1.2.8 fixed a particularly nasty bug that occurred if you added a new category with the Summary View open. The summary view would be messed up as a result.

And, I’m still working on the charts. With the pie chart mostly solved, I’ve moved on to the bar chart. How does this look?
Bar Chart

More on OpenGL

I’m starting to get the feeling OpenGL is a bit of a black art. That beautiful chart sample I posted yesterday throws a “failed to initialize OpenGL” error on the MacBook and my old G4. The code ran fine on my development machine, of course.

So, back to the books. The repository contains a version that should degrade gracefully on machines that can’t push OpenGL as hard as my new iMac with the ATI graphics card. Please let me know the results, and the machine stats, including the Graphics sub-system.

I would really appreciate it if anyone could grab the latest version from SVN and run it on a really old machine with OS 10.4. There’s no reason that the graphics shouldn’t work if the machine is capable of running Tiger.

Please let me know the results, and the machine stats, including the graphics sub-system. Many thanks.

Charts Update

Initial response to the charts project has been positive, and a few people have checked out the code. A number of folks commented on the lack of anti-aliasing, so I dove back into the OpenGL books, and came up with this:

Window.jpg

Much better, don’t you think?

HorizonCharts

Horizon really needs charts. Pie charts, bar charts, maybe even line charts. But I want the charts to look good, not like 20-year-old ‘Harvard Graphics’ charts. That started my search for a decent charting plug-in or toolset for Horizon, and I quickly discovered that there’s not much out there. So I proposed starting a community project to build a modern charting package. That got some attention on the MacSB mailing list, so I forged onward.

Now I have something to show for it. I have a pie-charting ‘framework’ ready for people to play with. (‘Framework’ is in quotes because it’s not a framework in the Cocoa/Obj-C sense of the word, but more like a scaffolding to build on.) The code is available from the svn repository at http://lucernesys.com/horizoncharts/trunk/ . If you’re a developer who is interested in this project please check it out and build it.

CocoaPieChart.jpg

The demo program builds a 3D pie chart with four ‘slices’. The chart is interactive; click and move the mouse pointer up and down to spin the chart, left and right to tilt the chart. If you hold down the control key and move left and right you’ll ‘explode’ the chart, making the slices move away from each other.

Right now, I’m the only person with ‘commit’ access to the repository. I hope that will change as more developers become involved. If you’re interested in working on this, contact me through my site. I plan to release it under some form of collaborative, non-restrictive license.

This code is based on a public domain sample I found online, and was originally written in Python. More about that in another post.

Version 1.2.7

There’s a new release available today, and you should see it if you have automatic ‘Check For Updates’ turned on. If not, you can use the ‘Check for Updates” menu item under the ‘Horizon’ menu. This version has a number of improvements and enhancements. There is now an ‘Export to CSV’ function that will dump out your calendar in a format that a spreadsheet or similar program can read.

The cells have been enhanced so you can now drag them to the equation edit field to create a reference. If you click or drag a cell to make it part of a range for a function, the cell will now display its current date, instead of its value. If you’re just referencing the cell as part of a simple equation, you should just see its value. The cells should be context-sensitive, so please let me know if something doesn’t look right. While editing a value or function, the date of the cell appears in the field prompt, and the text is set to the category colour. This should make it easier for you to see which cell you are editing, especially if you move around the calendar while creating or editing a cell.

I’ve also fixed a number of mild but annoying bugs, and Horizon should run fine under Leopard, for those of you running the beta versions. This could change as the beta changes, so Horizon is still only guaranteed to work on Tiger.

New Development System

Since its inception, Horizon has been developed on a Dual 450 Mhz G4 PowerMac, that was built sometime in the year 2000. I acquired it second-hand in 2003, and it’s been my ‘daily driver’ up until yesterday.

That’s when my new machine arrived, a 2.4 Ghz Core 2 Duo iMac. Almost immediately, I stuck an extra Gig of RAM in it, and hooked it up to a Western Digital MyBook Pro FireWire drive. This drive is going to serve double-cuty as a back-up drive and a boot drive for Leopard.

Now, the hope is that I’ll be able to get more work done more quickly on this new machine, and the time between releases should get shorter. Stay tuned and we’ll see if that happens.

BTW, I love the new Mac keyboards, but I guess that’s because I have small hands.

Mac To School

Just a quick post to let you know that Horizon is part of the MacToSchool bundle that gets you $300 or so worth of software for $49.95. There’s some really good programs in there besides Horizon, so you’re really getting a deal. And the previously promised Horizon 1.3 will be a free upgrade from the existing version, so there’s no need to wait. Go get it now! :)

Coming Soon

I’ve got a bunch of small features to add to Horizon, enhanced navigation, customized Holidays, the requisite bug fixes, but one thing that you won’t be seeing soon is graphs. I was planning on putting graphs like this: SM2DGraphViewShot.jpg

But then Apple came out with ‘Numbers’: Apple - iWork - Numbers - Impressive Results Fast.jpg
and I realized those flat charts were just unacceptable. So, it’s going to take me a little while to learn how to draw 3-D styled charts for Horizon. I’d rather give you something really great than something that’s just ‘okay’.
There will be graphs in some future release of version 1, you won’t have to wait for version 2. Version 2 will be a complete re-write, taking everything I’ve learned from version 1, both the good and the bad, and building a quantum leap version of Horizon. There’s a bunch of very cool things I have planned for version 2, but I’m keep them under my hat for now.

In Case Anyone Was Wondering …

why I’m not just grabbing the iCal files for holidays from here and parsing them into Horizon, it’s because Apple seems to treat every day with a special name as a ‘holiday’.
In Horizon, holidays are days when the banks and financial institutions are closed, and most people aren’t working. Apple includes, at least for Canada and the U.S.: Election Day’, ‘Daylight Savings’, ‘Groundhog Day’, just to name a few.