Patch: New graphs

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
Zojj
Engineer
Engineer
Posts: 97
Joined: 27 Apr 2007 17:58
Location: Vegas baby
Contact:

Patch: New graphs

Post by Zojj »

Here is what I have so far. I modified a cool idea from this post for the cargo payment graph.

Latest diff availiable here.

Differences from trunk:
Black background
Sizeable, sticky graph windows
25 year history
Smooth, Growth and % change* options.
Cargo payment graph based on speed and distance
Speed easily adjustable
Cargo legend same as player legend.
Cargo sorted by initial value.

*% change currently sucks.
Attachments
cargo payments.png
cargo payments.png (23.57 KiB) Viewed 34756 times
new graphs r9872.diff
(58.89 KiB) Downloaded 908 times
company growth smooth.png
company growth smooth.png (15.11 KiB) Viewed 34728 times
Last edited by Zojj on 15 Jul 2007 08:23, edited 12 times in total.
I'm on the Zoloft to keep me from killing yall

My patches: Better graphs - Train acceleration - Crash rates
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

diff, please ;)

(good work, indeed)
User avatar
Zojj
Engineer
Engineer
Posts: 97
Joined: 27 Apr 2007 17:58
Location: Vegas baby
Contact:

Post by Zojj »

It is only half done. Diff in a day or 3. =)
I'm on the Zoloft to keep me from killing yall

My patches: Better graphs - Train acceleration - Crash rates
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Post by Rubidium »

What about black-on-black as used in the graph with cargos.
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Post by kaan »

very nice :)

Code: Select all

if (YouAreHappyAndYouKnowIt) {
    ClapYourHands();
}
User avatar
Ailure
Route Supervisor
Route Supervisor
Posts: 435
Joined: 26 Apr 2005 19:06
Location: Sweden

Post by Ailure »

Damn, I love you know. I always found the old graphs being too restrictive, same for the old budget window. I hope it will be possible to have data over the like, last 100 years too. :)
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

I don't like the black background too much, I think staying with the old gray would be way better.
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

I think it is way easier to read the graph with black background.
Yes, it looks different somehow.
But over time we will get used to it.
hertogjan
Director
Director
Posts: 560
Joined: 03 Jan 2006 20:45
Location: Netherlands

Post by hertogjan »

Just a little suggestion...
Would it be possible to show a graph with the growth (in percent) of the profit, income, and/or the company value*? It would also be nice to have the level of inflation shown in such a graph.
I would even suggest that growth of income or company value (minus inflation) should become an entry of the performance rating.


*In separate graphs, of course.
User avatar
Born Acorn
Tycoon
Tycoon
Posts: 7595
Joined: 10 Dec 2002 20:36
Skype: bornacorn
Location: Wrexham, Wales
Contact:

Post by Born Acorn »

Ooh, I like the black background, much more stylish than the dark grey.
Image
Psistorm
Traffic Manager
Traffic Manager
Posts: 173
Joined: 05 Jun 2004 12:22

Post by Psistorm »

I also love the black background! makes it much easier to read, imo. theres only one suggestion: maybe make the "year seperator lines" a bit more visible, I didnt notice they were there until I looked closely
User avatar
Zojj
Engineer
Engineer
Posts: 97
Joined: 27 Apr 2007 17:58
Location: Vegas baby
Contact:

Post by Zojj »

Thanks all for feedback.
Rubidium wrote:What about black-on-black as used in the graph with cargos.
Good thought. I'll make black cargo dark gray in the graph. Or something.
Ailure wrote:I hope it will be possible to have data over the like, last 100 years too.
I have it saving 25 years now. Would need a scrollbar for more... hmm.
XeryusTC wrote:I don't like the black background too much
Born Acorn wrote:Ooh, I like the black background
This will be probably be a patch option. =)
hertogjan wrote:...graph with the growth (in percent)...
Good idea, I'll see.
I'm on the Zoloft to keep me from killing yall

My patches: Better graphs - Train acceleration - Crash rates
knedle
Traffic Manager
Traffic Manager
Posts: 158
Joined: 13 Apr 2007 17:07

Post by knedle »

You could add some options to select background colors, so everyone can get whatever he likes (pink with yellow hearts and blue flowers for example ;) ).
User avatar
PouncingAnt
Transport Coordinator
Transport Coordinator
Posts: 357
Joined: 09 Nov 2004 22:33

Post by PouncingAnt »

Good job, this is a huge improvement!
NB: the below challenges are still open for submission, so feel free to perform necromancy on them!
Try the PouncingAnt National Monopoly Challenge
Or even better, the PouncingAnt National Monopoly Challenge 2
Or better still, the PouncingAnt National Monopoly Challenge 3
Or, the PouncingAnt National Monopoly Challenge 4

Or try my scenario instead!

-(A lazy) OpenTTD Japanese Translator-
-(A lazy) PNGcodec user-
"You get what you pay for, so pay attention!"

Patches:
Company Station Stats
User avatar
Zojj
Engineer
Engineer
Posts: 97
Joined: 27 Apr 2007 17:58
Location: Vegas baby
Contact:

Post by Zojj »

Regular graphs almost done. =)

I'm open to suggestions for the name of the Growth button. It works for all history graphs, and is not always 'growth'.

.diff soon.
Last edited by Zojj on 19 May 2007 07:27, edited 1 time in total.
I'm on the Zoloft to keep me from killing yall

My patches: Better graphs - Train acceleration - Crash rates
hertogjan
Director
Director
Posts: 560
Joined: 03 Jan 2006 20:45
Location: Netherlands

Post by hertogjan »

Is the "Growth" in your patch being measured absolutely (i.e., equal to the difference of values of two consecutive moments, in pounds, euros, dollars, etc.) or relatively (i.e., equal to the absolute growth divided by the previous value, in percent)?
I would rather go for the second option (although it may be good to include both options). In a graph of relative growth it is also possible to show the inflation level, so that you can see whether your company value growth is higher than the inflation rate.
For profits, a relative graph can be a little bit tricky, since zero or negative profits are also possible. However, for quantities which are always positive, such as company value and income, this is not an issue (only division by zero needs to be ruled out).
User avatar
Zojj
Engineer
Engineer
Posts: 97
Joined: 27 Apr 2007 17:58
Location: Vegas baby
Contact:

Post by Zojj »

Diff up! See 1st post. Smooth is smooth =)

hertogjan,
I added a percent change button per request, but the graph it creates is not interesting. It needs different constraints, and maybe a logarithmic scale... even then I don't know if it would be useful. Feel free to play with the percent code, maybe you can find something that works!
Attachments
delivered normal.png
delivered normal.png (10.89 KiB) Viewed 34759 times
delivered smooth.png
delivered smooth.png (9.56 KiB) Viewed 34736 times
I'm on the Zoloft to keep me from killing yall

My patches: Better graphs - Train acceleration - Crash rates
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Post by kaan »

That looks so sweet!

Really nice work :)

Code: Select all

if (YouAreHappyAndYouKnowIt) {
    ClapYourHands();
}
hertogjan
Director
Director
Posts: 560
Joined: 03 Jan 2006 20:45
Location: Netherlands

Post by hertogjan »

About the smoothing function, what exactly does it do? Is it true that if you enable it, then the graph doesn't show the actual values? If so, I find that confusing. I would rather go for showing the actual data points, but a smoothed line. Then the points generally do not lie on the graph, but may be below or above it.*
As for the growth percentage, the patch is computing the growth relative to the last quarter (if I'm not mistaken). In my opinion, the growth relative to the same quarter of the previous year is more interesting.
For the quantities that can take negative values (e.g. operating profit), it is better to show nothing (i.e., growth is undefined) if either the current point or the previous point (or both) has a negative value.
I did not read the code very thoroughly, so I don't know what you have done so far to eliminate large growth percantages if the value of the previous data point is low, but it may be necessary to limit the values shown on the graph to, say, 1000%.

I hope these suggestions are useful.


*If you don't understand it at this point, ask me for a picture to explain it.
fabca2
Transport Coordinator
Transport Coordinator
Posts: 312
Joined: 14 Apr 2004 15:18
Location: Fr

Post by fabca2 »

@hertogjan

I really like the smooth that Zojj did, let me explain you.
see the green "normal" lines...
from year 2025 to 2031, you see the draw has two values : 190 and 380.
it's like your train just performed one or two trip during the quarter (long trip).
does it mean something ? does 2025Q2 had twice activity of 2025Q3 ? (no, in fact your train was on road)
does it mean your trains was broken ? no..
the flow was the same, it's just the trip are very long.

finaly look at the smooth graph, it's closer than reality : average value of 280.
these value are not wrong, it just than quarter value are too tight.
Imagine daily values : you will have just zero every where and from time to time some high value...

and if really you prefer raw value, don't use the smooth button ;)

@zojj : please keep it like this ;)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Bing [Bot] and 13 guests