Charting

I have an internet connection again! Its been a boring week or so, I can tell you that much.

I also got lucky enough to be in an area that got an upgrade not long ago, so I switched from a really crappy DSL service to something a little better. We’ll see how it stabilises over the coming days, but its really good to be back online.

One of the things I’ve been playing around with recently is pChart. I’ve fed it some data from my price checks which I’ve kept a backlog of since April of last year (technically longer, but I missed some months, apparently), and then it renders pretty graph pictures like this one:

10mn Afterburner II

Click to view the slightly larger version if you actually want to see what the values are and stuff.

I haven’t yet decided if this is something really awesome, or mostly pointless.

The graph is kind of interesting to see the tracked price of any given item over time, but it only becomes truly useful when I start mapping the build costs of items I make against the market prices so that I can better see which items have the higher margins. Up until now, I’ve just build the maximum amount of everything, knowing full well that I make a loss on some of the items. My philosophy is mostly to keep the market nicely saturated, whether I make a profit or not; but its always nice to see facts and figures rather than stumbling around in the dark, making loads of money but not really understanding where you’re making said money.

My other issue with pChart is probably something really basic that I’m missing. I know I can call the script directly, or have it stuffed into an <img> element, but it refuses to give me anything but a raw output of the image (open a png image in notepad and you’ll see) if I choose to have it rendered on the screen. Sure, I can have them rendered server-side and saved to a directory – that works – but I don’t want to have to run a separate script each time I want to see an updated chart. Likewise, I don’t really want to be losing archived data. I have the result set limited to 12 months, which can’t be seen here yet, due to an incomplete data set, but I’d really like to do fun stuff like year-on-year comparisons of profits and price histories.

I set the whole thing up as a function that I can pass variables to for prices, dates (month names in the data set), and the name of the item itself. The database query then grabs all of the relevant data matching the id of a drop-down option and renders the correct chart+values to the screen… Its a lot simpler than it sounds (even if it doesn’t work correctly yet).

The other option is to use something more interactive to output my data. I had a look around for some nice (and free) jQuery charting solutions, but there wasn’t anything that really took my fancy. Does anyone have any recommendations for this sort of thing?

This is the first part of my planning to make what I do in-game a bit verbose – if only for myself. It mostly consists of trying random stuff out and seeing if it can do what I need it to do, then moving onto something else. I’m currently planning on simply using my own data rather than diving into the static data dump, though that’s always an option.

If you’re interested in making cool stuff using the static data dump though, I suggest you check this series out, because its definitely a good primer.

Comments for this Post

Leave a Reply

Your email address will not be published. Required fields are marked *