What I’m trying to do
In my daily notes template I have checklist for “good habits” I keep track of and that I then render into a pie chart in a note attached in a sidebar pane.
``` tracker
searchType: task.done, task.notdone
searchTarget: Yoga,Yoga
startDate: -1w
fitPanelWidth: true
margin: -40,0,-40,0
pie:
data: '{{sum(dataset(0))}},{{7-sum(dataset(0))}}'
dataColor: "#A40E4C,whiteSmoke"
showExtLabelOnlyIfNoLabel: true
ratioInnerRadius: 0.5
This looks pretty much exactly as I would want it except that the chart in the sidebar pane doesn’t update when I check off an item from my list.
What I’ve tried
Switching between preview-mode and edit mode doesn’t update the chart.
The only way to get the chart to update seems to be that I either change the code of the codeblock or that I close the note and re-open it. Both of which are no real solutions. I keep my Obsidian vault open all the time and rarely reboot.
Ideally I want the chart in the sidebar to update as soon as I click the item in my daily note. I would also be fine if it would only update periodically.
I dug into the code of Obsidian tracker and it seems to be using registerMarkdownCodeBlockProcessor to render the code block into a chart. I imagine Obsidian does some behind the scenes optimisation so that rendering of code block processors is only triggered when the text is changed or file re-opened.
Any ideas how I can get this to work? Thanks!