pyrochlore / obsidian-tracker

A plugin tracks occurrences and numbers in your notes
MIT License
1.36k stars 230 forks source link

Summary cannot display in a line graph? #318

Closed EgnaroJQ closed 9 months ago

EgnaroJQ commented 9 months ago

I tried to add summary to a line graph but it failed to display. My code is as below:

searchType: frontmatter 
searchTarget: Workout (min) 
folder: 00 Diary 
startDate: 2024-02-12 
line: 
    title: Workout(min)
summary:            
    template: "Total: {{sum()}} hours"

Did I write something wrong? Or summary cannot show in a line graph?

stracker-phil commented 9 months ago

I think you can only use a single tracker per chart - you have to decide if you want to use a summary or a line chart. The summary displays a single line of text, no chart, so you can add the summary before (or after) the actual chart:

Summary:

searchType: frontmatter 
searchTarget: Workout (min) 
folder: 00 Diary 
startDate: 2024-02-12 
summary:            
    template: "Total: {{sum()}} hours"

Details:

searchType: frontmatter 
searchTarget: Workout (min) 
folder: 00 Diary 
startDate: 2024-02-12 
line: 
    title: Workout(min)
lazyguru commented 9 months ago

@stracker-phil is correct. You need to do 2 separate dataview blocks