[tw5] A very BASIC pie-charting service

Much prettier pie-charts can be created with javascript and CSS.

This is for older folk like me who like BASIC programming.

Enter the following in a tiddler in some TiddlyWiki:
(ignore the triple-backticks; they are just to format the code correctly for TalkTiddlyWiki)

<iframe src="https://basicanywheremachine.neocities.org/sample_programs/Pie%20Chart%20Service.prod.run?SCREEN=17&DATA=12,36,13,12,25,42,30,26,20,49," style="width:250px;height:250px;"> </iframe>

More details in this blog entry.

(By the way, should you actually find this thing useful and you actually like rough-around-the-edges old-school-charm, do save the HTML file and save it where you need it, because my hosted file might not be reliable/stable as a “service”.)

2 Likes

Good stuff!

Oh, just to demonstrate dynamic generation of that URL (scenario: percentage of tiddlers vs percentage of shadows), paste the following into a tiddler in some TiddlyWiki instance:
(if viewing this post in Google Groups, ignore the triple-backtick bookends)


<$let tid_count={{{ [all[tiddlers]count[]] }}}
sh_count={{{ [all[shadows]count[]] }}}
tot_count={{{ [all[shadows]] [all[tiddlers]] +[count[]] }}}
tid_pct = {{{ [<tid_count>divide<tot_count>multiply[100]] }}}
sh_pct = {{{ [<sh_count>divide<tot_count>multiply[100]] }}} >

* Percentage of Tiddlers: <<tid_pct>>
* Percentage of Shadows: <<sh_pct>>

<iframe src={{{ [[https://basicanywheremachine.neocities.org/sample_programs/Pie%20Chart%20Service.prod.run?SCREEN=17&DATA=]] =[<tid_pct>] =[[,]] =[[15]] =[[,]] =[<sh_pct>] =[[,]] =[[42]] =[[,]] +[join[]] }}} style="width:250px;height:250px;"> </iframe>

</$let>

1 Like