Patch: New graphs
Moderator: OpenTTD Developers
Patch: New graphs
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.
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 (23.57 KiB) Viewed 37275 times
-
- new graphs r9872.diff
- (58.89 KiB) Downloaded 1033 times
-
- company growth smooth.png (15.11 KiB) Viewed 37247 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
My patches: Better graphs - Train acceleration - Crash rates
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
My patches: Better graphs - Train acceleration - Crash rates
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)

OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone

OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone







-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
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.
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.
- Born Acorn
- Tycoon
- Posts: 7596
- Joined: 10 Dec 2002 20:36
- Skype: bornacorn
- Location: Wrexham, Wales
- Contact:
Thanks all for feedback.
Good thought. I'll make black cargo dark gray in the graph. Or something.Rubidium wrote:What about black-on-black as used in the graph with cargos.
I have it saving 25 years now. Would need a scrollbar for more... hmm.Ailure wrote:I hope it will be possible to have data over the like, last 100 years too.
XeryusTC wrote:I don't like the black background too much
This will be probably be a patch option. =)Born Acorn wrote:Ooh, I like the black background
Good idea, I'll see.hertogjan wrote:...graph with the growth (in percent)...
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
- PouncingAnt
- Transport Coordinator
- Posts: 357
- Joined: 09 Nov 2004 22:33
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
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
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.
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
My patches: Better graphs - Train acceleration - Crash rates
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).
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).
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!
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 (10.89 KiB) Viewed 37278 times
-
- delivered smooth.png (9.56 KiB) Viewed 37255 times
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
That looks so sweet!
Really nice work
Really nice work

Code: Select all
if (YouAreHappyAndYouKnowIt) {
ClapYourHands();
}
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.
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.
@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
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

Who is online
Users browsing this forum: No registered users and 7 guests