A very BASIC pie-charting service

37 views
Skip to first unread message

Charlie Veniot

unread,
Sep 8, 2023, 12:33:26 AM9/8/23
to TiddlyWiki
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)

```
```


(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".)

Ste

unread,
Sep 10, 2023, 6:02:23 AM9/10/23
to TiddlyWiki
Good stuff! 

Charlie Veniot

unread,
Sep 10, 2023, 1:19:49 PM9/10/23
to TiddlyWiki
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>


```
Reply all
Reply to author
Forward
0 new messages