Networth makeup

Started by Raggon, December 10, 2011, 05:12:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Raggon

Wow. Doesn't seem too hard.

Then again, I am not an expert on this kind of stuff.
I void warranties
Silence is golden, but duct tape is silver
What happens if you get scared half to death twice?

windhound

That is kinda neat
My problem with that CSS method is that each browser has a different kludge required to make it work and IE support is null.
Kludges suck, and the technique is is apparently new enough that noone has standardized on it -- which means that eventually it'll probably break.
I think I can call in a css script mid page, like right before the chart is drawn, because it'll have to be dynamically modified for each chart build.  The guide is assuming static, unchanging values.

The article is a year old, will poke around and see if anything has changed in a year

Sharptooth, that link describes how to do it in YUI which is an entire web framework.  If you'll notice, the first line of that snippet calls the YUI() function, then calls subfunctions.  There's a lot more going on there.

The PHP methods work fine, its just they're usually several mb of chart code -- and when you step back, its one chart on a rarely used page that we're draggin in a code base larger than the entire game.

It'd be a nice addition, sure, but if adds too much complexity its simply not worth it.
A Goldfish has an attention span of 3 seconds...  so do I
~ In the beginning there was nothing, which exploded ~
There are only 10 types of people in the world: Those who understand binary, and those who don't

Sharptooh

Quote from: windhound on December 17, 2011, 10:18:38 PM
Sharptooth, that link describes how to do it in YUI which is an entire web framework.  If you'll notice, the first line of that snippet calls the YUI() function, then calls subfunctions.  There's a lot more going on there.

I realise that YUI is an entire JS framework windy, I didn't just search "Charts on webpages" and click the first result :P I have had some experience with YUI

You're right, there's a lot more going on there than you'd think, but out of all of the methods, in terms of time needed to set up, this would trump both other methods, and in terms of accessibility (which is why CSS isn't being used) it ranks pretty well (who doesn't have JavaScript enabled nowadays?)

Just my thoughts anyway, there's probably time better spent on other things than pie charts showing networth breakdowns.

Shadow

Quote(who doesn't have JavaScript enabled nowadays?)
NoScript ftw!
<=holbs-.. ..-holbs=> <=holbs-..

Sharptooh

Quote from: Shadow on December 18, 2011, 08:18:42 AM
Quote(who doesn't have JavaScript enabled nowadays?)
NoScript ftw!

Je Deteste le no script!

windhound

Quote from: Sharptooh on December 18, 2011, 07:55:20 AM
Quote from: windhound on December 17, 2011, 10:18:38 PM
Sharptooth, that link describes how to do it in YUI which is an entire web framework.  If you'll notice, the first line of that snippet calls the YUI() function, then calls subfunctions.  There's a lot more going on there.

I realise that YUI is an entire JS framework windy, I didn't just search "Charts on webpages" and click the first result :P I have had some experience with YUI

You're right, there's a lot more going on there than you'd think, but out of all of the methods, in terms of time needed to set up, this would trump both other methods, and in terms of accessibility (which is why CSS isn't being used) it ranks pretty well (who doesn't have JavaScript enabled nowadays?)

Just my thoughts anyway, there's probably time better spent on other things than pie charts showing networth breakdowns.

You were advocating installing an entire framework inorder to do one chart on a rarely used page?
dood.
YUI is 8.1mb of code, RWL is 1.6mb

If you wanted javascript, a very quick google turned up Bluff - http://bluff.jcoglan.com/  Bluff and its dependencies are 65kb, a heck of a lot better, making its use plausible.  Its even fully cross browser, IE included.
A Goldfish has an attention span of 3 seconds...  so do I
~ In the beginning there was nothing, which exploded ~
There are only 10 types of people in the world: Those who understand binary, and those who don't

Sharptooh

Windy the core of YUI (http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js) is only 66kb (well, by my check anyway) obviously you have to import the chart module (and any modules that is needs to work) but I very much doubt that would total anywhere near to 8.1mb (although I might be wrong)

Importing the whole library could prove useful if features implemented at a later date required any of the libraries features; besides which most visitors likely have the library cached in their browser.

Although saying that, bluff looks good too, never realized that there are bits of JavaScript specifically built to handle only graphs!

windhound

Oh, that's cool.  Didn't realize it was modular, just clicked the recommended package.

PHP is apparently terrible at drawing things, I found one chart drawing package (bar, pie, line, etc) that was like 12mb of code.  Found another that was "only" 4mb. 
Compared to your standard desktop application these numbers don't seem large, but 12mb of just plaintext code is rather large - esp. if you're just using it to plot things.

If I have time later I might poke around, the CSS version and Bluff look decent, though I have no pre-attachment to either

Trying to think of any other page it'd be useful and not obnoxious to throw a chart on, can't think of any.
A Goldfish has an attention span of 3 seconds...  so do I
~ In the beginning there was nothing, which exploded ~
There are only 10 types of people in the world: Those who understand binary, and those who don't

Sharptooh

Quote from: windhound on December 19, 2011, 01:15:17 AM
Trying to think of any other page it'd be useful and not obnoxious to throw a chart on, can't think of any.

I've always thought that it'd be cool to have a stats page with graphs plotting things such as total land / networth value of everyone on the server, maybe the markets networth value too? Possibly some other values too.

Although I doubt very much that would be useful in anyway, and it'd require some DB work so probably not worth it really.

I'm sure there's other ways this could be used to good effect though.

Shadow

<=holbs-.. ..-holbs=> <=holbs-..

Durza

All could be useful.  People see numbers and think one thing, but when the see a graph of the numbers those numbers tak on a different meaning because of the visual aspect.
Question Mark (?)
Life is chaos, some of it is just more orderly.
Not liable for anything a Spa mod may change in my posts