By using metaedit, dataview and Kanban, now we could track all us projects with a progress-bar. Watch video here: https://youtu.be/TbWdI-trdvo
First, you should set metaedit plugin like (for make metaedit autoupdate variable):
Then, put these into your Kanban’s YAML Frontmatter:
Title: /*(Set anything if you want)*/
kanban-plugin: basic
tag: projects
Total: /*(Metaedit will auto-update these variable)*/
Incomplete:
Completed:
Finally, put code below into your project tracking note:
```dataviewjs
function projectTracker(dv, query) {
let searchPagePaths = dv.pages(query).file.path
for(let i=0; i < searchPagePaths.length; i++){
if(dv.page(searchPagePaths[i]).Total){
let title = dv.page(searchPagePaths[i]).Title;
console
let total = dv.page(searchPagePaths[i]).Total;
let status = ((dv.page(searchPagePaths[i]).Completed / dv.page(searchPagePaths[i]).Total) * 100).toFixed();
const progress = ""; //you could set any width if you need
dv.paragraph(progress);
dv.paragraph("<br>"); //use this if you have many projects to track.
}
}
}
projectTracker(
dv,
"#projects" //change tag if you need
)
```
Yep, you did it. You will get something like this below: