d2jsp
Log InRegister
d2jsp Forums > d2jsp > General Help > Site Suggestions >
Poll > Fg Chart
Prev123Next
Add Reply New Topic New Poll
  Guests cannot view or vote in polls. Please register or login.
Member
Posts: 87,007
Joined: May 12 2013
Gold: 1,590.64
Apr 26 2016 06:53pm
Nice voted yes
Retired Moderator
Posts: 34,248
Joined: Apr 10 2011
Gold: 300.00
Trader: Trusted
Apr 26 2016 07:52pm
Nice job!
Voted yes :thumbsup:
Member
Posts: 3,028
Joined: Mar 23 2016
Gold: 7,568.50
Apr 26 2016 08:41pm
Quote (njaguar @ Apr 27 2016 01:20am)
Right, the script could easily just store and cache a month in a localStorage or IndexedDB, then use that to display more than the current month's data. It would still require you to manually go back through each month, at least once (to build your local cache), but yeah, it's possible to do it.


I took your advice and did exactly that using localStorage. Since localStorage can only pass strings, I had to use JSON.stringify/parse to be able to pass the gold value/date array, which introduced a new issue with decoding JSON dates (see http://weblog.west-wind.com/posts/2014/Jan/06/JavaScript-JSON-Date-Parsing-and-real-Dates ) so what I did instead is rewrite it to keep using unix time and only convert that to real dates at the last second. I also had to reset the localstorage manually every time I wanted to test something but that's merely an inconvenience :P

Anyway, here's the slightly cleaner code for version 2:

http://pastebin.com/YyPjMB51

And the JSFiddle to try it out:

https://jsfiddle.net/m7vgwz19/

It seems to work on my end for March and April now, unfortunately I've only got two months' worth of gold logs to test it with so I'm not 100% confident it works with more, but it should. Would love it if someone could try it out and report back.

And thanks for your support everyone! I really appreciate it.

This post was edited by annexusquam on Apr 26 2016 08:45pm
Member
Posts: 3,028
Joined: Mar 23 2016
Gold: 7,568.50
Apr 27 2016 09:43pm
Thanks to Rigzy who helped me test it I know it should work on as many months as needed. The script can't view months individually anymore though (it uses everything it finds in local storage), and I forgot to change the title. Still, it's progress and those are issues I can fix :)

Here's what it looks like with his gold logs dating to 2011:

https://i.imgur.com/KCWNlZG.jpg

And here's my less impressive "rags-to-riches" :lol: history:

https://i.imgur.com/U8tkzcs.jpg

This post was edited by annexusquam on Apr 27 2016 09:49pm
Member
Posts: 3,028
Joined: Mar 23 2016
Gold: 7,568.50
Apr 30 2016 02:12am
Added a button to switch between monthly & cumulative view.

Code: http://pastebin.com/c0eeVemX

Bookmarklet: https://jsfiddle.net/1snyk7eb/1/

And a quick demo:

Member
Posts: 3,028
Joined: Mar 23 2016
Gold: 7,568.50
May 1 2016 02:11pm
Bump in case someone wants to use it. :)

Will let this thread die after that.
Retired Moderator
Posts: 34,248
Joined: Apr 10 2011
Gold: 300.00
Trader: Trusted
May 1 2016 08:34pm
Quote (annexusquam @ May 1 2016 04:11pm)
Bump in case someone wants to use it. :)

Will let this thread die after that.


Don't give up man!
I'll keep bumping if I have to. :p
Retired Moderator
Posts: 34,248
Joined: Apr 10 2011
Gold: 300.00
Trader: Trusted
May 3 2016 06:59am
:bouncy:
Member
Posts: 2,909
Joined: Oct 30 2013
Gold: 1,242.80
May 3 2016 05:26pm
Yes.
Member
Posts: 518
Joined: Mar 14 2012
Gold: 1,773.92
May 4 2016 01:22pm
100% yes
Go Back To Site Suggestions Topic List
Prev123Next
Add Reply New Topic New Poll